Fixed More Constructors

Now ALL wrappers use Plugin
This commit is contained in:
Lewis Fox 2012-06-30 13:08:31 -05:00
parent 716a784e20
commit c1f5eb9070
11 changed files with 38 additions and 44 deletions

View File

@ -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;

View File

@ -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));
}
}

View File

@ -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));
}

View File

@ -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));
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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.");