From c1f5eb9070936b95ed29e003925161b2345de93a Mon Sep 17 00:00:00 2001 From: Lewis Fox Date: Sat, 30 Jun 2012 13:08:31 -0500 Subject: [PATCH] Fixed More Constructors Now ALL wrappers use Plugin --- .../vault/chat/plugins/Chat_DroxPerms.java | 11 +++++------ .../vault/chat/plugins/Chat_GroupManager.java | 12 ++++++------ .../vault/chat/plugins/Chat_Permissions3.java | 14 +++++++------- .../vault/chat/plugins/Chat_PermissionsEx.java | 12 ++++++------ .../vault/chat/plugins/Chat_bPermissions.java | 5 ++--- .../vault/chat/plugins/Chat_bPermissions2.java | 5 ++--- .../milkbowl/vault/chat/plugins/Chat_mChat.java | 4 ++-- .../vault/chat/plugins/Chat_mChatSuite.java | 4 ++-- .../vault/economy/plugins/Economy_Craftconomy.java | 5 ++--- .../vault/economy/plugins/Economy_iConomy5.java | 5 ++--- .../vault/economy/plugins/Economy_iConomy6.java | 5 ++--- 11 files changed, 38 insertions(+), 44 deletions(-) diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_DroxPerms.java b/src/net/milkbowl/vault/chat/plugins/Chat_DroxPerms.java index 467aeb9..dfd10e6 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_DroxPerms.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_DroxPerms.java @@ -2,13 +2,9 @@ package net.milkbowl.vault.chat.plugins; import java.util.logging.Logger; -import net.milkbowl.vault.Vault; import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.permission.Permission; -import de.hydrox.bukkit.DroxPerms.DroxPerms; -import de.hydrox.bukkit.DroxPerms.DroxPermsAPI; - import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -16,14 +12,17 @@ import org.bukkit.event.Listener; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.plugin.Plugin; +import de.hydrox.bukkit.DroxPerms.DroxPerms; +import de.hydrox.bukkit.DroxPerms.DroxPermsAPI; + public class Chat_DroxPerms extends Chat { private static final Logger log = Logger.getLogger("Minecraft"); private final String name = "DroxPerms"; - private Vault plugin; + private Plugin plugin; private DroxPermsAPI API; - public Chat_DroxPerms(Vault plugin, Permission perms) { + public Chat_DroxPerms(Plugin plugin, Permission perms) { super(perms); this.plugin = plugin; diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java b/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java index 28ef160..2585e34 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_GroupManager.java @@ -40,17 +40,17 @@ public class Chat_GroupManager extends Chat { private Plugin plugin = null; private GroupManager groupManager; - public Chat_GroupManager(Plugin plugin, Permission permissions) { - super(permissions); + public Chat_GroupManager(Plugin plugin, Permission perms) { + super(perms); this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin); // Load Plugin in case it was loaded before if (groupManager == null) { - Plugin perms = plugin.getServer().getPluginManager().getPlugin("GroupManager"); - if (perms != null) { - if (perms.isEnabled()) { - groupManager = (GroupManager) perms; + Plugin chat = plugin.getServer().getPluginManager().getPlugin("GroupManager"); + if (chat != null) { + if (chat.isEnabled()) { + groupManager = (GroupManager) chat; log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name)); } } diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java index 9fe4902..b143560 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java @@ -39,22 +39,22 @@ public class Chat_Permissions3 extends Chat { private Plugin plugin = null; private Permissions chat = null; - public Chat_Permissions3(Plugin plugin, Permission permissions) { - super(permissions); + public Chat_Permissions3(Plugin plugin, Permission perms) { + super(perms); this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(), plugin); // Load Plugin in case it was loaded before if (chat == null) { - Plugin perms = plugin.getServer().getPluginManager().getPlugin("Permissions"); - if (perms == null) { + Plugin p = plugin.getServer().getPluginManager().getPlugin("Permissions"); + if (p == null) { plugin.getServer().getPluginManager().getPlugin("vPerms"); name = "vPerms - Chat"; } - if (perms != null) { - if (perms.isEnabled() && perms.getDescription().getVersion().startsWith("3")) { - chat = (Permissions) perms; + if (p != null) { + if (p.isEnabled() && p.getDescription().getVersion().startsWith("3")) { + chat = (Permissions) p; this.perms = chat.getHandler(); log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name)); } diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java b/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java index c02f3ed..d0e0bfd 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_PermissionsEx.java @@ -39,18 +39,18 @@ public class Chat_PermissionsEx extends Chat { private Plugin plugin = null; private PermissionsEx chat = null; - public Chat_PermissionsEx(Plugin plugin, Permission permissions) { - super(permissions); + public Chat_PermissionsEx(Plugin plugin, Permission perms) { + super(perms); this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin); // Load Plugin in case it was loaded before if (chat == null) { - Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsEx"); - if (perms != null) { - if (perms.isEnabled()) { - chat = (PermissionsEx) perms; + Plugin p = plugin.getServer().getPluginManager().getPlugin("PermissionsEx"); + if (p != null) { + if (p.isEnabled()) { + chat = (PermissionsEx) p; log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name)); } } diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java b/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java index 0ba65a0..9e75a3d 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions.java @@ -17,7 +17,6 @@ package net.milkbowl.vault.chat.plugins; import java.util.logging.Logger; -import net.milkbowl.vault.Vault; import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.permission.Permission; @@ -35,10 +34,10 @@ import de.bananaco.permissions.info.InfoReader; public class Chat_bPermissions extends Chat { private static final Logger log = Logger.getLogger("Minecraft"); private final String name = "bInfo"; - private Vault plugin = null; + private Plugin plugin = null; InfoReader chat; - public Chat_bPermissions(Vault plugin, Permission perms) { + public Chat_bPermissions(Plugin plugin, Permission perms) { super(perms); this.plugin = plugin; diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions2.java b/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions2.java index 0e1ed3c..5204abc 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions2.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_bPermissions2.java @@ -17,7 +17,6 @@ package net.milkbowl.vault.chat.plugins; import java.util.logging.Logger; -import net.milkbowl.vault.Vault; import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.permission.Permission; @@ -35,10 +34,10 @@ import de.bananaco.bpermissions.api.util.CalculableType; public class Chat_bPermissions2 extends Chat { private static final Logger log = Logger.getLogger("Minecraft"); private final String name = "bInfo"; - private Vault plugin = null; + private Plugin plugin = null; private boolean hooked = false; - public Chat_bPermissions2(Vault plugin, Permission perms) { + public Chat_bPermissions2(Plugin plugin, Permission perms) { super(perms); this.plugin = plugin; diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java b/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java index 314e55a..17af304 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_mChat.java @@ -36,8 +36,8 @@ public class Chat_mChat extends Chat { private Plugin plugin = null; private mChatAPI mChat = null; - public Chat_mChat(Plugin plugin, Permission permissions) { - super(permissions); + public Chat_mChat(Plugin plugin, Permission perms) { + super(perms); this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin); diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_mChatSuite.java b/src/net/milkbowl/vault/chat/plugins/Chat_mChatSuite.java index 2c74ee7..ca29e3c 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_mChatSuite.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_mChatSuite.java @@ -40,8 +40,8 @@ public class Chat_mChatSuite extends Chat { private Reader mReader = null; private Writer mWriter = null; - public Chat_mChatSuite(Plugin plugin, Permission permissions) { - super(permissions); + public Chat_mChatSuite(Plugin plugin, Permission perms) { + super(perms); this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin); diff --git a/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy.java b/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy.java index d171326..ccf66f9 100644 --- a/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy.java +++ b/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy.java @@ -37,16 +37,15 @@ import org.bukkit.event.Listener; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPlugin; public class Economy_Craftconomy implements Economy { private static final Logger log = Logger.getLogger("Minecraft"); private final String name = "Craftconomy"; - private JavaPlugin plugin = null; + private Plugin plugin = null; protected Craftconomy economy = null; - public Economy_Craftconomy(JavaPlugin plugin) { + public Economy_Craftconomy(Plugin plugin) { this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin); diff --git a/src/net/milkbowl/vault/economy/plugins/Economy_iConomy5.java b/src/net/milkbowl/vault/economy/plugins/Economy_iConomy5.java index 4ab721e..4b1494a 100644 --- a/src/net/milkbowl/vault/economy/plugins/Economy_iConomy5.java +++ b/src/net/milkbowl/vault/economy/plugins/Economy_iConomy5.java @@ -30,7 +30,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPlugin; import com.iConomy.iConomy; import com.iConomy.system.Holdings; @@ -40,10 +39,10 @@ public class Economy_iConomy5 implements Economy { private static final Logger log = Logger.getLogger("Minecraft"); private final String name = "iConomy 5"; - private JavaPlugin plugin = null; + private Plugin plugin = null; protected iConomy economy = null; - public Economy_iConomy5(JavaPlugin plugin) { + public Economy_iConomy5(Plugin plugin) { this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin); // Load Plugin in case it was loaded before diff --git a/src/net/milkbowl/vault/economy/plugins/Economy_iConomy6.java b/src/net/milkbowl/vault/economy/plugins/Economy_iConomy6.java index 3724a8f..8ccfd1c 100644 --- a/src/net/milkbowl/vault/economy/plugins/Economy_iConomy6.java +++ b/src/net/milkbowl/vault/economy/plugins/Economy_iConomy6.java @@ -29,7 +29,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.java.JavaPlugin; import com.iCo6.Constants; import com.iCo6.iConomy; @@ -40,11 +39,11 @@ public class Economy_iConomy6 implements Economy { private static final Logger log = Logger.getLogger("Minecraft"); private final String name = "iConomy 6"; - private JavaPlugin plugin = null; + private Plugin plugin = null; protected iConomy economy = null; private Accounts accounts; - public Economy_iConomy6(JavaPlugin plugin) { + public Economy_iConomy6(Plugin plugin) { this.plugin = plugin; Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin); log.warning("iConomy6 - If you are using Flatfile storage be aware that iCo6 has a CRITICAL bug which can wipe ALL iconomy data.");