Merge pull request #210 from LRFLEW/master

Fixed More Constructors
This commit is contained in:
Nick Minkler 2012-06-30 11:33:29 -07:00
commit 16b40c24ab
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 java.util.logging.Logger;
import net.milkbowl.vault.Vault;
import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.permission.Permission; 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.Bukkit;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -16,14 +12,17 @@ import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import de.hydrox.bukkit.DroxPerms.DroxPerms;
import de.hydrox.bukkit.DroxPerms.DroxPermsAPI;
public class Chat_DroxPerms extends Chat { public class Chat_DroxPerms extends Chat {
private static final Logger log = Logger.getLogger("Minecraft"); private static final Logger log = Logger.getLogger("Minecraft");
private final String name = "DroxPerms"; private final String name = "DroxPerms";
private Vault plugin; private Plugin plugin;
private DroxPermsAPI API; private DroxPermsAPI API;
public Chat_DroxPerms(Vault plugin, Permission perms) { public Chat_DroxPerms(Plugin plugin, Permission perms) {
super(perms); super(perms);
this.plugin = plugin; this.plugin = plugin;

View File

@ -40,17 +40,17 @@ public class Chat_GroupManager extends Chat {
private Plugin plugin = null; private Plugin plugin = null;
private GroupManager groupManager; private GroupManager groupManager;
public Chat_GroupManager(Plugin plugin, Permission permissions) { public Chat_GroupManager(Plugin plugin, Permission perms) {
super(permissions); super(perms);
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin); Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin);
// Load Plugin in case it was loaded before // Load Plugin in case it was loaded before
if (groupManager == null) { if (groupManager == null) {
Plugin perms = plugin.getServer().getPluginManager().getPlugin("GroupManager"); Plugin chat = plugin.getServer().getPluginManager().getPlugin("GroupManager");
if (perms != null) { if (chat != null) {
if (perms.isEnabled()) { if (chat.isEnabled()) {
groupManager = (GroupManager) perms; groupManager = (GroupManager) chat;
log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name)); 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 Plugin plugin = null;
private Permissions chat = null; private Permissions chat = null;
public Chat_Permissions3(Plugin plugin, Permission permissions) { public Chat_Permissions3(Plugin plugin, Permission perms) {
super(permissions); super(perms);
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(), plugin); Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(), plugin);
// Load Plugin in case it was loaded before // Load Plugin in case it was loaded before
if (chat == null) { if (chat == null) {
Plugin perms = plugin.getServer().getPluginManager().getPlugin("Permissions"); Plugin p = plugin.getServer().getPluginManager().getPlugin("Permissions");
if (perms == null) { if (p == null) {
plugin.getServer().getPluginManager().getPlugin("vPerms"); plugin.getServer().getPluginManager().getPlugin("vPerms");
name = "vPerms - Chat"; name = "vPerms - Chat";
} }
if (perms != null) { if (p != null) {
if (perms.isEnabled() && perms.getDescription().getVersion().startsWith("3")) { if (p.isEnabled() && p.getDescription().getVersion().startsWith("3")) {
chat = (Permissions) perms; chat = (Permissions) p;
this.perms = chat.getHandler(); this.perms = chat.getHandler();
log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name)); 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 Plugin plugin = null;
private PermissionsEx chat = null; private PermissionsEx chat = null;
public Chat_PermissionsEx(Plugin plugin, Permission permissions) { public Chat_PermissionsEx(Plugin plugin, Permission perms) {
super(permissions); super(perms);
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin); Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), plugin);
// Load Plugin in case it was loaded before // Load Plugin in case it was loaded before
if (chat == null) { if (chat == null) {
Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsEx"); Plugin p = plugin.getServer().getPluginManager().getPlugin("PermissionsEx");
if (perms != null) { if (p != null) {
if (perms.isEnabled()) { if (p.isEnabled()) {
chat = (PermissionsEx) perms; chat = (PermissionsEx) p;
log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), name)); 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 java.util.logging.Logger;
import net.milkbowl.vault.Vault;
import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
@ -35,10 +34,10 @@ import de.bananaco.permissions.info.InfoReader;
public class Chat_bPermissions extends Chat { public class Chat_bPermissions extends Chat {
private static final Logger log = Logger.getLogger("Minecraft"); private static final Logger log = Logger.getLogger("Minecraft");
private final String name = "bInfo"; private final String name = "bInfo";
private Vault plugin = null; private Plugin plugin = null;
InfoReader chat; InfoReader chat;
public Chat_bPermissions(Vault plugin, Permission perms) { public Chat_bPermissions(Plugin plugin, Permission perms) {
super(perms); super(perms);
this.plugin = plugin; this.plugin = plugin;

View File

@ -17,7 +17,6 @@ package net.milkbowl.vault.chat.plugins;
import java.util.logging.Logger; import java.util.logging.Logger;
import net.milkbowl.vault.Vault;
import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
@ -35,10 +34,10 @@ import de.bananaco.bpermissions.api.util.CalculableType;
public class Chat_bPermissions2 extends Chat { public class Chat_bPermissions2 extends Chat {
private static final Logger log = Logger.getLogger("Minecraft"); private static final Logger log = Logger.getLogger("Minecraft");
private final String name = "bInfo"; private final String name = "bInfo";
private Vault plugin = null; private Plugin plugin = null;
private boolean hooked = false; private boolean hooked = false;
public Chat_bPermissions2(Vault plugin, Permission perms) { public Chat_bPermissions2(Plugin plugin, Permission perms) {
super(perms); super(perms);
this.plugin = plugin; this.plugin = plugin;

View File

@ -36,8 +36,8 @@ public class Chat_mChat extends Chat {
private Plugin plugin = null; private Plugin plugin = null;
private mChatAPI mChat = null; private mChatAPI mChat = null;
public Chat_mChat(Plugin plugin, Permission permissions) { public Chat_mChat(Plugin plugin, Permission perms) {
super(permissions); super(perms);
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), 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 Reader mReader = null;
private Writer mWriter = null; private Writer mWriter = null;
public Chat_mChatSuite(Plugin plugin, Permission permissions) { public Chat_mChatSuite(Plugin plugin, Permission perms) {
super(permissions); super(perms);
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new PermissionServerListener(this), 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.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
public class Economy_Craftconomy implements Economy { public class Economy_Craftconomy implements Economy {
private static final Logger log = Logger.getLogger("Minecraft"); private static final Logger log = Logger.getLogger("Minecraft");
private final String name = "Craftconomy"; private final String name = "Craftconomy";
private JavaPlugin plugin = null; private Plugin plugin = null;
protected Craftconomy economy = null; protected Craftconomy economy = null;
public Economy_Craftconomy(JavaPlugin plugin) { public Economy_Craftconomy(Plugin plugin) {
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), 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.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import com.iConomy.iConomy; import com.iConomy.iConomy;
import com.iConomy.system.Holdings; import com.iConomy.system.Holdings;
@ -40,10 +39,10 @@ public class Economy_iConomy5 implements Economy {
private static final Logger log = Logger.getLogger("Minecraft"); private static final Logger log = Logger.getLogger("Minecraft");
private final String name = "iConomy 5"; private final String name = "iConomy 5";
private JavaPlugin plugin = null; private Plugin plugin = null;
protected iConomy economy = null; protected iConomy economy = null;
public Economy_iConomy5(JavaPlugin plugin) { public Economy_iConomy5(Plugin plugin) {
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin); Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), plugin);
// Load Plugin in case it was loaded before // 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.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import com.iCo6.Constants; import com.iCo6.Constants;
import com.iCo6.iConomy; import com.iCo6.iConomy;
@ -40,11 +39,11 @@ public class Economy_iConomy6 implements Economy {
private static final Logger log = Logger.getLogger("Minecraft"); private static final Logger log = Logger.getLogger("Minecraft");
private final String name = "iConomy 6"; private final String name = "iConomy 6";
private JavaPlugin plugin = null; private Plugin plugin = null;
protected iConomy economy = null; protected iConomy economy = null;
private Accounts accounts; private Accounts accounts;
public Economy_iConomy6(JavaPlugin plugin) { public Economy_iConomy6(Plugin plugin) {
this.plugin = plugin; this.plugin = plugin;
Bukkit.getServer().getPluginManager().registerEvents(new EconomyServerListener(this), 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."); log.warning("iConomy6 - If you are using Flatfile storage be aware that iCo6 has a CRITICAL bug which can wipe ALL iconomy data.");