diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/McMMO.java similarity index 97% rename from src/main/java/com/gmail/nossr50/mcMMO.java rename to src/main/java/com/gmail/nossr50/McMMO.java index 5269d4e7c..ed394c5ae 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/McMMO.java @@ -78,7 +78,7 @@ import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.blockmeta.ChunkletManager; import com.gmail.nossr50.util.blockmeta.ChunkletManagerFactory; -public class mcMMO extends JavaPlugin { +public class McMMO extends JavaPlugin { private final PlayerListener playerListener = new PlayerListener(this); private final BlockListener blockListener = new BlockListener(this); @@ -91,7 +91,7 @@ public class mcMMO extends JavaPlugin { public static File versionFile; public static Database database; - public static mcMMO p; + public static McMMO p; public static ChunkletManager placeStore; public static RepairManager repairManager; diff --git a/src/main/java/com/gmail/nossr50/api/ChatAPI.java b/src/main/java/com/gmail/nossr50/api/ChatAPI.java index 48dfc0ca0..380ed24f1 100644 --- a/src/main/java/com/gmail/nossr50/api/ChatAPI.java +++ b/src/main/java/com/gmail/nossr50/api/ChatAPI.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.api; import org.bukkit.ChatColor; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.util.Permissions; @@ -21,7 +21,7 @@ public class ChatAPI { */ public void sendPartyChat(String sender, String party, String message) { McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(sender, party, message); - mcMMO.p.getServer().getPluginManager().callEvent(chatEvent); + McMMO.p.getServer().getPluginManager().callEvent(chatEvent); if (chatEvent.isCancelled()) { return; @@ -29,9 +29,9 @@ public class ChatAPI { String pPrefix = ChatColor.GREEN + "(" + ChatColor.WHITE + chatEvent.getSender() + ChatColor.GREEN + ") "; - mcMMO.p.getLogger().info("[P](" + chatEvent.getParty() + ")" + "<" + chatEvent.getSender() + "> " + chatEvent.getMessage()); + McMMO.p.getLogger().info("[P](" + chatEvent.getParty() + ")" + "<" + chatEvent.getSender() + "> " + chatEvent.getMessage()); - for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { + for (Player player : McMMO.p.getServer().getOnlinePlayers()) { if (Users.getProfile(player).inParty()) { if (Users.getProfile(player).getParty().equalsIgnoreCase(chatEvent.getParty())) { player.sendMessage(pPrefix + chatEvent.getMessage()); @@ -50,7 +50,7 @@ public class ChatAPI { */ public void sendAdminChat(String sender, String message) { McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(sender, message); - mcMMO.p.getServer().getPluginManager().callEvent(chatEvent); + McMMO.p.getServer().getPluginManager().callEvent(chatEvent); if (chatEvent.isCancelled()) { return; @@ -58,9 +58,9 @@ public class ChatAPI { String aPrefix = ChatColor.AQUA + "{" + ChatColor.WHITE + chatEvent.getSender() + ChatColor.AQUA + "} "; - mcMMO.p.getLogger().info("[A]<" + chatEvent.getSender() + "> " + chatEvent.getMessage()); + McMMO.p.getLogger().info("[A]<" + chatEvent.getSender() + "> " + chatEvent.getMessage()); - for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { + for (Player player : McMMO.p.getServer().getOnlinePlayers()) { if (Permissions.getInstance().adminChat(player) || player.isOp()) player.sendMessage(aPrefix + chatEvent.getMessage()); } diff --git a/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java b/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java index 062b48443..d87c22b0d 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/AddlevelsCommand.java @@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -17,9 +17,9 @@ import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class AddlevelsCommand implements CommandExecutor{ - private final mcMMO plugin; + private final McMMO plugin; - public AddlevelsCommand (mcMMO plugin) { + public AddlevelsCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/general/AddxpCommand.java b/src/main/java/com/gmail/nossr50/commands/general/AddxpCommand.java index c7533cf5a..34808e2c1 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/AddxpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/AddxpCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -17,9 +17,9 @@ import com.gmail.nossr50.util.Users; //TODO: Any way we can make this work for offline use? public class AddxpCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public AddxpCommand (mcMMO plugin) { + public AddxpCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java index b3bd81f13..c2ba97796 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -16,9 +16,9 @@ import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class InspectCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public InspectCommand (mcMMO plugin) { + public InspectCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java b/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java index 4e0f3d679..e98ab4002 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java @@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -17,9 +17,9 @@ import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class MmoeditCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public MmoeditCommand (mcMMO plugin) { + public MmoeditCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/general/MmoupdateCommand.java b/src/main/java/com/gmail/nossr50/commands/general/MmoupdateCommand.java index 2f6b4a2b0..fa0a5d5b8 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/MmoupdateCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/MmoupdateCommand.java @@ -6,16 +6,16 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.runnables.SQLConversionTask; import com.gmail.nossr50.util.Users; public class MmoupdateCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public MmoupdateCommand (mcMMO plugin) { + public MmoupdateCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java b/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java index 502cf0b58..93b90ce42 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/XprateCommand.java @@ -5,18 +5,18 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Misc; public class XprateCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; private static int oldrate = Config.getInstance().xpGainMultiplier; public static boolean xpevent = false; - public XprateCommand (mcMMO plugin) { + public XprateCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java index 98661d898..bb7bcb304 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McmmoCommand.java @@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.getspout.spoutapi.player.SpoutPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.locale.LocaleLoader; @@ -19,7 +19,7 @@ public class McmmoCommand implements CommandExecutor { sender.sendMessage(mcSplit); if (Config.getInstance().getDonateMessageEnabled()) { - if (mcMMO.spoutEnabled && sender instanceof SpoutPlayer) { + if (McMMO.spoutEnabled && sender instanceof SpoutPlayer) { SpoutPlayer sPlayer = (SpoutPlayer) sender; sPlayer.sendNotification(ChatColor.YELLOW + "[mcMMO]" + ChatColor.GOLD + " Donate!", ChatColor.GREEN + "mcmmodev@gmail.com", Material.DIAMOND); diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java index fd460cbcd..0bb7d90f0 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McrefreshCommand.java @@ -7,16 +7,16 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Users; public class McrefreshCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public McrefreshCommand(mcMMO instance) { + public McrefreshCommand(McMMO instance) { this.plugin = instance; } diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java index 38f9c1f27..e8b4e8b5b 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McremoveCommand.java @@ -10,7 +10,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.locale.LocaleLoader; @@ -18,11 +18,11 @@ import com.gmail.nossr50.util.Users; public class McremoveCommand implements CommandExecutor { private final String location; - private final mcMMO plugin; + private final McMMO plugin; - public McremoveCommand (mcMMO plugin) { + public McremoveCommand (McMMO plugin) { this.plugin = plugin; - this.location = mcMMO.usersFile; + this.location = McMMO.usersFile; } @Override @@ -51,30 +51,30 @@ public class McremoveCommand implements CommandExecutor { /* MySQL */ if (Config.getInstance().getUseMySQL()) { int userId = 0; - userId = mcMMO.database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'"); + userId = McMMO.database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'"); if (userId > 0) { - mcMMO.database.write("DELETE FROM " + McMMO.database.write("DELETE FROM " + databaseName + "." + tablePrefix + "users WHERE " + tablePrefix + "users.id=" + userId); - mcMMO.database.write("DELETE FROM " + McMMO.database.write("DELETE FROM " + databaseName + "." + tablePrefix + "cooldowns WHERE " + tablePrefix + "cooldowns.user_id=" + userId); - mcMMO.database.write("DELETE FROM " + McMMO.database.write("DELETE FROM " + databaseName + "." + tablePrefix + "huds WHERE " + tablePrefix + "huds.user_id=" + userId); - mcMMO.database.write("DELETE FROM " + McMMO.database.write("DELETE FROM " + databaseName + "." + tablePrefix + "skills WHERE " + tablePrefix + "skills.user_id=" + userId); - mcMMO.database.write("DELETE FROM " + McMMO.database.write("DELETE FROM " + databaseName + "." + tablePrefix + "experience WHERE " + tablePrefix + "experience.user_id=" + userId); diff --git a/src/main/java/com/gmail/nossr50/commands/mc/MctopCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/MctopCommand.java index 6b5ac3368..33f157dcb 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/MctopCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/MctopCommand.java @@ -8,7 +8,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Leaderboard; @@ -134,7 +134,7 @@ public class MctopCommand implements CommandExecutor { private void sqlDisplay(int page, String query, CommandSender sender) { String tablePrefix = Config.getInstance().getMySQLTablePrefix(); - HashMap> userslist = mcMMO.database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC "); + HashMap> userslist = McMMO.database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC "); if (query == "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing") { sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); @@ -144,11 +144,11 @@ public class MctopCommand implements CommandExecutor { } for (int i = (page * 10) - 9; i <= (page * 10); i++) { - if (i > userslist.size() || mcMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) { + if (i > userslist.size() || McMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) { break; } - HashMap> username = mcMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); + HashMap> username = McMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); sender.sendMessage(String.valueOf(i) + ". " + ChatColor.GREEN + userslist.get(i).get(0) + " - " + ChatColor.WHITE + username.get(1).get(0)); } } diff --git a/src/main/java/com/gmail/nossr50/commands/party/ACommand.java b/src/main/java/com/gmail/nossr50/commands/party/ACommand.java index 6e3517296..1079e9b03 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/ACommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/ACommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; @@ -15,9 +15,9 @@ import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Users; public class ACommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public ACommand (mcMMO plugin) { + public ACommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/AcceptCommand.java b/src/main/java/com/gmail/nossr50/commands/party/AcceptCommand.java index e18e9aeaf..95b080e58 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/AcceptCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/AcceptCommand.java @@ -5,7 +5,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; @@ -15,9 +15,9 @@ import com.gmail.nossr50.party.Party; import com.gmail.nossr50.util.Users; public class AcceptCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public AcceptCommand (mcMMO plugin) { + public AcceptCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/InviteCommand.java b/src/main/java/com/gmail/nossr50/commands/party/InviteCommand.java index 89276c60c..9d1cf8291 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/InviteCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/InviteCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; @@ -15,9 +15,9 @@ import com.gmail.nossr50.util.Users; //TODO: Make this work from console. public class InviteCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public InviteCommand(mcMMO instance) { + public InviteCommand(McMMO instance) { this.plugin = instance; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/PCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PCommand.java index a1951cc6a..acf158f8c 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; @@ -15,9 +15,9 @@ import com.gmail.nossr50.party.Party; import com.gmail.nossr50.util.Users; public class PCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public PCommand (mcMMO plugin) { + public PCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index 6a7283d5a..6bba28b3f 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; @@ -16,9 +16,9 @@ import com.gmail.nossr50.party.Party; import com.gmail.nossr50.util.Users; public class PartyCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public PartyCommand (mcMMO plugin) { + public PartyCommand (McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index 38c2e8a42..bf9d57759 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerProfile; @@ -16,9 +16,9 @@ import com.gmail.nossr50.party.Party; import com.gmail.nossr50.util.Users; public class PtpCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public PtpCommand(mcMMO instance) { + public PtpCommand(McMMO instance) { this.plugin = instance; } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 89aab4651..2c28922e8 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.SkillType; @@ -36,10 +36,10 @@ public class RepairCommand extends SkillCommand { @Override protected void dataCalculations() { // We're using pickaxes here, not the best but it works - Repairable diamondRepairable = mcMMO.repairManager.getRepairable(278); - Repairable goldRepairable = mcMMO.repairManager.getRepairable(285); - Repairable ironRepairable = mcMMO.repairManager.getRepairable(257); - Repairable stoneRepairable = mcMMO.repairManager.getRepairable(274); + Repairable diamondRepairable = McMMO.repairManager.getRepairable(278); + Repairable goldRepairable = McMMO.repairManager.getRepairable(285); + Repairable ironRepairable = McMMO.repairManager.getRepairable(257); + Repairable stoneRepairable = McMMO.repairManager.getRepairable(274); diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel(); goldLevel = (goldRepairable == null) ? 0 : goldRepairable.getMinimumLevel(); diff --git a/src/main/java/com/gmail/nossr50/commands/spout/MchudCommand.java b/src/main/java/com/gmail/nossr50/commands/spout/MchudCommand.java index f897af818..cd63e52df 100644 --- a/src/main/java/com/gmail/nossr50/commands/spout/MchudCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/spout/MchudCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.datatypes.HUDType; @@ -17,9 +17,9 @@ import com.gmail.nossr50.spout.SpoutStuff; import com.gmail.nossr50.util.Users; public class MchudCommand implements CommandExecutor { - private final mcMMO plugin; + private final McMMO plugin; - public MchudCommand (mcMMO plugin) { + public MchudCommand (McMMO plugin) { this.plugin = plugin; } @@ -32,7 +32,7 @@ public class MchudCommand implements CommandExecutor { return true; } - if (!mcMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled()) { + if (!McMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled()) { sender.sendMessage(LocaleLoader.getString("Commands.Disabled")); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/spout/XplockCommand.java b/src/main/java/com/gmail/nossr50/commands/spout/XplockCommand.java index cb2b43e0f..7ca3d5768 100644 --- a/src/main/java/com/gmail/nossr50/commands/spout/XplockCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/spout/XplockCommand.java @@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.SpoutConfig; @@ -28,7 +28,7 @@ public class XplockCommand implements CommandExecutor { return true; } - if (!mcMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) { + if (!McMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) { sender.sendMessage(LocaleLoader.getString("Commands.Disabled")); return true; } diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 5fdf2035f..fc8b6d5a1 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -5,7 +5,7 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public class Config extends ConfigLoader { public int xpGainMultiplier = 1; @@ -13,7 +13,7 @@ public class Config extends ConfigLoader { public static Config getInstance() { if (instance == null) { - instance = new Config(mcMMO.p); + instance = new Config(McMMO.p); instance.load(); } @@ -375,7 +375,7 @@ public class Config extends ConfigLoader { * CONFIG LOADING */ - private Config(mcMMO plugin) { + private Config(McMMO plugin) { super(plugin, "config.yml"); saveIfNotExist(); xpGainMultiplier = getExperienceGainsGlobalMultiplier(); diff --git a/src/main/java/com/gmail/nossr50/config/ConfigLoader.java b/src/main/java/com/gmail/nossr50/config/ConfigLoader.java index 97865fa02..fb7b611e2 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigLoader.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigLoader.java @@ -6,16 +6,16 @@ import java.io.IOException; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public abstract class ConfigLoader { protected String fileName; protected File configFile; protected File dataFolder; - protected final mcMMO plugin; + protected final McMMO plugin; protected FileConfiguration config; - public ConfigLoader(mcMMO plugin, String fileName){ + public ConfigLoader(McMMO plugin, String fileName){ this.plugin = plugin; this.fileName = fileName; dataFolder = plugin.getDataFolder(); diff --git a/src/main/java/com/gmail/nossr50/config/HiddenConfig.java b/src/main/java/com/gmail/nossr50/config/HiddenConfig.java index bf908205f..3fc9b91e8 100644 --- a/src/main/java/com/gmail/nossr50/config/HiddenConfig.java +++ b/src/main/java/com/gmail/nossr50/config/HiddenConfig.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.config; import org.bukkit.configuration.file.YamlConfiguration; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public class HiddenConfig extends ConfigLoader { private static String fileName; @@ -11,7 +11,7 @@ public class HiddenConfig extends ConfigLoader { private static boolean chunkletsEnabled; - public HiddenConfig(mcMMO plugin, String fileName) { + public HiddenConfig(McMMO plugin, String fileName) { super(plugin, fileName); HiddenConfig.fileName = fileName; } @@ -19,7 +19,7 @@ public class HiddenConfig extends ConfigLoader { public static HiddenConfig getInstance() { if (instance == null) { - instance = new HiddenConfig(mcMMO.p, "hidden.yml"); + instance = new HiddenConfig(McMMO.p, "hidden.yml"); instance.load(); } diff --git a/src/main/java/com/gmail/nossr50/config/RepairConfig.java b/src/main/java/com/gmail/nossr50/config/RepairConfig.java index 36999ee45..e70eb5793 100644 --- a/src/main/java/com/gmail/nossr50/config/RepairConfig.java +++ b/src/main/java/com/gmail/nossr50/config/RepairConfig.java @@ -7,7 +7,7 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.skills.repair.RepairItemType; import com.gmail.nossr50.skills.repair.RepairMaterialType; import com.gmail.nossr50.skills.repair.Repairable; @@ -16,7 +16,7 @@ import com.gmail.nossr50.skills.repair.RepairableFactory; public class RepairConfig extends ConfigLoader { private List repairables; - public RepairConfig(mcMMO plugin, String fileName) { + public RepairConfig(McMMO plugin, String fileName) { super(plugin, fileName); this.config = YamlConfiguration.loadConfiguration(this.configFile); } diff --git a/src/main/java/com/gmail/nossr50/config/RepairConfigManager.java b/src/main/java/com/gmail/nossr50/config/RepairConfigManager.java index 00cedcdf7..9c3ceea5f 100644 --- a/src/main/java/com/gmail/nossr50/config/RepairConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/RepairConfigManager.java @@ -5,13 +5,13 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.skills.repair.Repairable; public class RepairConfigManager { private List repairables; - public RepairConfigManager(mcMMO plugin) { + public RepairConfigManager(McMMO plugin) { repairables = new ArrayList(); Pattern pattern = Pattern.compile("repair\\.(?:.+)\\.yml"); diff --git a/src/main/java/com/gmail/nossr50/config/SpoutConfig.java b/src/main/java/com/gmail/nossr50/config/SpoutConfig.java index 25930c1cf..2eb27d9ca 100644 --- a/src/main/java/com/gmail/nossr50/config/SpoutConfig.java +++ b/src/main/java/com/gmail/nossr50/config/SpoutConfig.java @@ -1,6 +1,6 @@ package com.gmail.nossr50.config; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.HUDType; public class SpoutConfig extends ConfigLoader { @@ -8,7 +8,7 @@ public class SpoutConfig extends ConfigLoader { public static SpoutConfig getInstance() { if (instance == null) { - instance = new SpoutConfig(mcMMO.p); + instance = new SpoutConfig(McMMO.p); instance.load(); } @@ -17,7 +17,7 @@ public class SpoutConfig extends ConfigLoader { public HUDType defaulthud; - private SpoutConfig(mcMMO plugin) { + private SpoutConfig(McMMO plugin) { super(plugin, "spout.yml"); saveIfNotExist(); } diff --git a/src/main/java/com/gmail/nossr50/config/TreasuresConfig.java b/src/main/java/com/gmail/nossr50/config/TreasuresConfig.java index bb4e4179c..945e95fc1 100644 --- a/src/main/java/com/gmail/nossr50/config/TreasuresConfig.java +++ b/src/main/java/com/gmail/nossr50/config/TreasuresConfig.java @@ -11,7 +11,7 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.datatypes.treasure.FishingTreasure; import com.gmail.nossr50.datatypes.treasure.Treasure; @@ -21,7 +21,7 @@ public class TreasuresConfig extends ConfigLoader{ public static TreasuresConfig getInstance() { if (instance == null) { - instance = new TreasuresConfig(mcMMO.p); + instance = new TreasuresConfig(McMMO.p); instance.load(); } @@ -41,7 +41,7 @@ public class TreasuresConfig extends ConfigLoader{ public List fishingRewardsTier4 = new ArrayList(); public List fishingRewardsTier5 = new ArrayList(); - private TreasuresConfig(mcMMO plugin) { + private TreasuresConfig(McMMO plugin) { super(plugin, "treasures.yml"); saveIfNotExist(); } diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java index 783a25e83..2b6dd35b4 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomArmorConfig.java @@ -8,7 +8,7 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.mods.CustomItem; import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.RepairableFactory; @@ -18,7 +18,7 @@ public class CustomArmorConfig extends ModConfigLoader{ public static CustomArmorConfig getInstance() { if (instance == null) { - instance = new CustomArmorConfig(mcMMO.p); + instance = new CustomArmorConfig(McMMO.p); } return instance; @@ -35,7 +35,7 @@ public class CustomArmorConfig extends ModConfigLoader{ public List customArmorList = new ArrayList(); public HashMap customArmor = new HashMap(); - public CustomArmorConfig(mcMMO plugin) { + public CustomArmorConfig(McMMO plugin) { super(plugin, "armor.yml"); } diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java index 0eba9e247..770da8943 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomBlocksConfig.java @@ -8,7 +8,7 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.mods.CustomBlock; public class CustomBlocksConfig extends ModConfigLoader{ @@ -16,7 +16,7 @@ public class CustomBlocksConfig extends ModConfigLoader{ public static CustomBlocksConfig getInstance() { if (instance == null) { - instance = new CustomBlocksConfig(mcMMO.p); + instance = new CustomBlocksConfig(McMMO.p); } return instance; @@ -34,7 +34,7 @@ public class CustomBlocksConfig extends ModConfigLoader{ public List customItems = new ArrayList(); public List customBlocks = new ArrayList(); - public CustomBlocksConfig(mcMMO plugin) { + public CustomBlocksConfig(McMMO plugin) { super(plugin, "blocks.yml"); } diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomToolsConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomToolsConfig.java index cfcab287a..ec9ea2c02 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomToolsConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomToolsConfig.java @@ -8,7 +8,7 @@ import java.util.Set; import org.bukkit.configuration.ConfigurationSection; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.mods.CustomTool; import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.RepairableFactory; @@ -18,7 +18,7 @@ public class CustomToolsConfig extends ModConfigLoader { public static CustomToolsConfig getInstance() { if (instance == null) { - instance = new CustomToolsConfig(mcMMO.p); + instance = new CustomToolsConfig(McMMO.p); } return instance; @@ -37,7 +37,7 @@ public class CustomToolsConfig extends ModConfigLoader { public List customToolList = new ArrayList(); public HashMap customTools = new HashMap(); - private CustomToolsConfig(mcMMO plugin) { + private CustomToolsConfig(McMMO plugin) { super(plugin, "tools.yml"); } diff --git a/src/main/java/com/gmail/nossr50/config/mods/ModConfigLoader.java b/src/main/java/com/gmail/nossr50/config/mods/ModConfigLoader.java index 08ad6afa2..6673c03c5 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/ModConfigLoader.java +++ b/src/main/java/com/gmail/nossr50/config/mods/ModConfigLoader.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.config.mods; import java.io.File; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.ConfigLoader; public abstract class ModConfigLoader extends ConfigLoader{ - public ModConfigLoader(mcMMO plugin, String fileName) { + public ModConfigLoader(McMMO plugin, String fileName) { super(plugin, "ModConfigs" + File.separator + fileName); } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/HUDmmo.java b/src/main/java/com/gmail/nossr50/datatypes/HUDmmo.java index 2259e82c4..92d31270d 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/HUDmmo.java +++ b/src/main/java/com/gmail/nossr50/datatypes/HUDmmo.java @@ -9,7 +9,7 @@ import org.getspout.spoutapi.gui.RenderPriority; import org.getspout.spoutapi.gui.Widget; import org.getspout.spoutapi.player.SpoutPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.spout.SpoutStuff; import com.gmail.nossr50.util.Misc; @@ -19,7 +19,7 @@ public class HUDmmo { private int center_x = 427 / 2; private String playerName; - private final mcMMO plugin; + private final McMMO plugin; private Widget xpbar = null; private GenericGradient xpfill = null; @@ -28,7 +28,7 @@ public class HUDmmo { private GenericGradient xpicon_border = null; private GenericTexture xpicon = null; - public HUDmmo(Player player, mcMMO plugin) { + public HUDmmo(Player player, McMMO plugin) { this.playerName = player.getName(); this.plugin = plugin; initializeHUD(player); diff --git a/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java index 60c525e8b..8f2e94afe 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -11,7 +11,7 @@ import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.datatypes.mods.CustomTool; @@ -62,7 +62,7 @@ public class PlayerProfile { private Player player; private String playerName; - private final static String location = mcMMO.usersFile; + private final static String location = McMMO.usersFile; public PlayerProfile(Player player, boolean addNew) { hud = SpoutConfig.getInstance().defaulthud; @@ -100,15 +100,15 @@ public class PlayerProfile { public boolean loadMySQL() { int id = 0; - id = mcMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'"); + id = McMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'"); this.userid = id; if (id > 0) { - HashMap> huds = mcMMO.database.read("SELECT hudtype FROM "+Config.getInstance().getMySQLTablePrefix()+"huds WHERE user_id = " + id); + HashMap> huds = McMMO.database.read("SELECT hudtype FROM "+Config.getInstance().getMySQLTablePrefix()+"huds WHERE user_id = " + id); if(huds.get(1) == null) { - mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"huds (user_id) VALUES ("+id+")"); + McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"huds (user_id) VALUES ("+id+")"); } else { if(huds.get(1).get(0) != null) { @@ -123,17 +123,17 @@ public class PlayerProfile { hud = SpoutConfig.getInstance().defaulthud; } } - HashMap> users = mcMMO.database.read("SELECT lastlogin, party FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE id = " + id); + HashMap> users = McMMO.database.read("SELECT lastlogin, party FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE id = " + id); //lastlogin = Integer.parseInt(users.get(1).get(0)); party = users.get(1).get(1); - HashMap> cooldowns = mcMMO.database.read("SELECT mining, woodcutting, unarmed, herbalism, excavation, swords, axes, blast_mining FROM "+Config.getInstance().getMySQLTablePrefix()+"cooldowns WHERE user_id = " + id); + HashMap> cooldowns = McMMO.database.read("SELECT mining, woodcutting, unarmed, herbalism, excavation, swords, axes, blast_mining FROM "+Config.getInstance().getMySQLTablePrefix()+"cooldowns WHERE user_id = " + id); /* * I'm still learning MySQL, this is a fix for adding a new table * its not pretty but it works */ if(cooldowns.get(1) == null) { - mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")"); + McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")"); } else { @@ -146,7 +146,7 @@ public class PlayerProfile { skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(cooldowns.get(1).get(6))); skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(cooldowns.get(1).get(7))); } - HashMap> stats = mcMMO.database.read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics, fishing FROM "+Config.getInstance().getMySQLTablePrefix()+"skills WHERE user_id = " + id); + HashMap> stats = McMMO.database.read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics, fishing FROM "+Config.getInstance().getMySQLTablePrefix()+"skills WHERE user_id = " + id); skills.put(SkillType.TAMING, Integer.valueOf(stats.get(1).get(0))); skills.put(SkillType.MINING, Integer.valueOf(stats.get(1).get(1))); skills.put(SkillType.REPAIR, Integer.valueOf(stats.get(1).get(2))); @@ -159,7 +159,7 @@ public class PlayerProfile { skills.put(SkillType.AXES, Integer.valueOf(stats.get(1).get(9))); skills.put(SkillType.ACROBATICS, Integer.valueOf(stats.get(1).get(10))); skills.put(SkillType.FISHING, Integer.valueOf(stats.get(1).get(11))); - HashMap> experience = mcMMO.database.read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics, fishing FROM "+Config.getInstance().getMySQLTablePrefix()+"experience WHERE user_id = " + id); + HashMap> experience = McMMO.database.read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics, fishing FROM "+Config.getInstance().getMySQLTablePrefix()+"experience WHERE user_id = " + id); skillsXp.put(SkillType.TAMING, Integer.valueOf(experience.get(1).get(0))); skillsXp.put(SkillType.MINING, Integer.valueOf(experience.get(1).get(1))); skillsXp.put(SkillType.REPAIR, Integer.valueOf(experience.get(1).get(2))); @@ -182,11 +182,11 @@ public class PlayerProfile { public void addMySQLPlayer() { int id = 0; - mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")"); - id = mcMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'"); - mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")"); - mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"skills (user_id) VALUES ("+id+")"); - mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"experience (user_id) VALUES ("+id+")"); + McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")"); + id = McMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'"); + McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")"); + McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"skills (user_id) VALUES ("+id+")"); + McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"experience (user_id) VALUES ("+id+")"); this.userid = id; } @@ -289,7 +289,7 @@ public class PlayerProfile { } in.close(); } catch (Exception e) { - mcMMO.p.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString()); + McMMO.p.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString()); } return false; } @@ -299,10 +299,10 @@ public class PlayerProfile { // if we are using mysql save to database if (Config.getInstance().getUseMySQL()) { - mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"huds SET hudtype = '"+hud.toString()+"' WHERE user_id = "+this.userid); - mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid); - mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET party = '"+this.party+"' WHERE id = " +this.userid); - mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"cooldowns SET " + McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"huds SET hudtype = '"+hud.toString()+"' WHERE user_id = "+this.userid); + McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid); + McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET party = '"+this.party+"' WHERE id = " +this.userid); + McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"cooldowns SET " +" mining = " + skillsDATS.get(AbilityType.SUPER_BREAKER) +", woodcutting = " + skillsDATS.get(AbilityType.TREE_FELLER) +", unarmed = " + skillsDATS.get(AbilityType.BERSERK) @@ -312,7 +312,7 @@ public class PlayerProfile { +", axes = " + skillsDATS.get(AbilityType.SKULL_SPLIITER) +", blast_mining = " + skillsDATS.get(AbilityType.BLAST_MINING) +" WHERE user_id = "+this.userid); - mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"skills SET " + McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"skills SET " +" taming = "+skills.get(SkillType.TAMING) +", mining = "+skills.get(SkillType.MINING) +", repair = "+skills.get(SkillType.REPAIR) @@ -326,7 +326,7 @@ public class PlayerProfile { +", acrobatics = "+skills.get(SkillType.ACROBATICS) +", fishing = "+skills.get(SkillType.FISHING) +" WHERE user_id = "+this.userid); - mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"experience SET " + McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"experience SET " +" taming = "+skillsXp.get(SkillType.TAMING) +", mining = "+skillsXp.get(SkillType.MINING) +", repair = "+skillsXp.get(SkillType.REPAIR) @@ -409,7 +409,7 @@ public class PlayerProfile { out.close(); } catch (Exception e) { - mcMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString()); + McMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString()); } } } @@ -484,7 +484,7 @@ public class PlayerProfile { out.newLine(); out.close(); } catch (Exception e) { - mcMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString()); + McMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString()); } } @@ -976,12 +976,12 @@ public class PlayerProfile { continue; } - mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, x, newValue)); + McMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, x, newValue)); skillsXp.put(x, skillsXp.get(x) + newValue); } } else { - mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, newValue)); + McMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, newValue)); skillsXp.put(skillType, skillsXp.get(skillType) + newValue); lastgained = skillType; } @@ -1046,7 +1046,7 @@ public class PlayerProfile { xp = xp * 2; } - mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, xp)); + McMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, xp)); skillsXp.put(skillType, skillsXp.get(skillType) + xp); lastgained = skillType; } diff --git a/src/main/java/com/gmail/nossr50/datatypes/popups/PopupMMO.java b/src/main/java/com/gmail/nossr50/datatypes/popups/PopupMMO.java index e182b5925..bf4db32f9 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/popups/PopupMMO.java +++ b/src/main/java/com/gmail/nossr50/datatypes/popups/PopupMMO.java @@ -5,7 +5,7 @@ import org.bukkit.entity.Player; import org.getspout.spoutapi.gui.GenericLabel; import org.getspout.spoutapi.gui.GenericPopup; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.buttons.ButtonEscape; import com.gmail.nossr50.datatypes.buttons.ButtonHUDStyle; @@ -19,7 +19,7 @@ public class PopupMMO extends GenericPopup { private int center_x = 427 / 2; private int center_y = 240 / 2; - public PopupMMO(Player player, PlayerProfile PP, mcMMO plugin) { + public PopupMMO(Player player, PlayerProfile PP, McMMO plugin) { //240, 427 are the bottom right mcMMO_label.setText(ChatColor.GOLD + "~mcMMO Menu~"); //TODO: Needs more locale diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 8e82e1335..bd28fda7f 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -19,7 +19,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.getspout.spoutapi.sound.SoundEffect; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.PlayerProfile; @@ -42,9 +42,9 @@ import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class BlockListener implements Listener { - private final mcMMO plugin; + private final McMMO plugin; - public BlockListener(final mcMMO plugin) { + public BlockListener(final McMMO plugin) { this.plugin = plugin; } @@ -59,15 +59,15 @@ public class BlockListener implements Listener { BlockFace direction = event.getDirection(); for (Block b : blocks) { - if (mcMMO.placeStore.isTrue(b)) { + if (McMMO.placeStore.isTrue(b)) { b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true)); - mcMMO.placeStore.setFalse(b); + McMMO.placeStore.setFalse(b); } } for (Block b : blocks) { if (b.getRelative(direction).hasMetadata("pistonTrack")) { - mcMMO.placeStore.setTrue(b.getRelative(direction)); + McMMO.placeStore.setTrue(b.getRelative(direction)); b.getRelative(direction).removeMetadata("pistonTrack", plugin); } } @@ -87,7 +87,7 @@ public class BlockListener implements Listener { Block fallenBlock = event.getBlock().getRelative(BlockFace.UP); if (fallenBlock.getType() == type) { - mcMMO.placeStore.setTrue(fallenBlock); + McMMO.placeStore.setTrue(fallenBlock); } } } @@ -101,9 +101,9 @@ public class BlockListener implements Listener { public void onBlockPistonRetract(BlockPistonRetractEvent event) { Block block = event.getRetractLocation().getBlock(); - if (event.isSticky() && mcMMO.placeStore.isTrue(block)) { - mcMMO.placeStore.setFalse(block); - mcMMO.placeStore.setTrue(event.getBlock().getRelative(event.getDirection())); + if (event.isSticky() && McMMO.placeStore.isTrue(block)) { + McMMO.placeStore.setFalse(block); + McMMO.placeStore.setTrue(event.getBlock().getRelative(event.getDirection())); } } @@ -129,7 +129,7 @@ public class BlockListener implements Listener { } else { Block newLocation = block.getRelative(0, y + 1, 0); - mcMMO.placeStore.setTrue(newLocation); + McMMO.placeStore.setTrue(newLocation); break; } } @@ -138,7 +138,7 @@ public class BlockListener implements Listener { /* Check if the blocks placed should be monitored so they do not give out XP in the future */ if (BlockChecks.shouldBeWatched(block)) { if (!((type == Material.SAND || type == Material.GRAVEL) && block.getRelative(BlockFace.DOWN).getType() == Material.AIR)) { //Don't wanna track sand that's gonna fall. - mcMMO.placeStore.setTrue(block); + McMMO.placeStore.setTrue(block); } } @@ -219,7 +219,7 @@ public class BlockListener implements Listener { } /* EXCAVATION */ - else if (BlockChecks.canBeGigaDrillBroken(block) && permInstance.excavation(player) && !mcMMO.placeStore.isTrue(block)) { + else if (BlockChecks.canBeGigaDrillBroken(block) && permInstance.excavation(player) && !McMMO.placeStore.isTrue(block)) { if (configInstance.getExcavationRequiresTool()) { if (ItemChecks.isShovel(inHand)) { Excavation.excavationProcCheck(block, player); @@ -231,8 +231,8 @@ public class BlockListener implements Listener { } //Remove metadata when broken - if (mcMMO.placeStore.isTrue(block) && BlockChecks.shouldBeWatched(block)) { - mcMMO.placeStore.setFalse(block); + if (McMMO.placeStore.isTrue(block) && BlockChecks.shouldBeWatched(block)) { + McMMO.placeStore.setFalse(block); } //Remove metadata from fallen sand/gravel @@ -243,11 +243,11 @@ public class BlockListener implements Listener { Block relative = block.getRelative(0, y, 0); Material relativeType = relative.getType(); - if ((relativeType == Material.SAND || relativeType == Material.GRAVEL) && mcMMO.placeStore.isTrue(relative)) { - mcMMO.placeStore.setFalse(relative); + if ((relativeType == Material.SAND || relativeType == Material.GRAVEL) && McMMO.placeStore.isTrue(relative)) { + McMMO.placeStore.setFalse(relative); } - else if (!BlockChecks.shouldBeWatched(relative) && mcMMO.placeStore.isTrue(relative)){ - mcMMO.placeStore.setFalse(relative); + else if (!BlockChecks.shouldBeWatched(relative) && McMMO.placeStore.isTrue(relative)){ + McMMO.placeStore.setFalse(relative); } else { break; @@ -301,7 +301,7 @@ public class BlockListener implements Listener { } /* TREE FELLER SOUNDS */ - if (mcMMO.spoutEnabled && BlockChecks.isLog(block) && PP.getAbilityMode(AbilityType.TREE_FELLER)) { + if (McMMO.spoutEnabled && BlockChecks.isLog(block) && PP.getAbilityMode(AbilityType.TREE_FELLER)) { SpoutSounds.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation()); } @@ -346,7 +346,7 @@ public class BlockListener implements Listener { event.setInstaBreak(true); } - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); } } diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 6ec3fc36e..7a301b2db 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -24,7 +24,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.metadata.FixedMetadataValue; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -43,9 +43,9 @@ import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class EntityListener implements Listener { - private final mcMMO plugin; + private final McMMO plugin; - public EntityListener(final mcMMO plugin) { + public EntityListener(final McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index f941583cf..395ef93a1 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -21,7 +21,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.commands.general.XprateCommand; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.AbilityType; @@ -45,9 +45,9 @@ import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class PlayerListener implements Listener { - private final mcMMO plugin; + private final McMMO plugin; - public PlayerListener(final mcMMO plugin) { + public PlayerListener(final McMMO plugin) { this.plugin = plugin; } @@ -139,7 +139,7 @@ public class PlayerListener implements Listener { /* GARBAGE COLLECTION */ //Remove Spout Stuff - if (mcMMO.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player)) { + if (McMMO.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player)) { SpoutStuff.playerHUDs.remove(player); } @@ -226,8 +226,8 @@ public class PlayerListener implements Listener { /* REPAIR CHECKS */ if (Permissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId()) { - if (mcMMO.repairManager.isRepairable(inHand)) { - mcMMO.repairManager.handleRepair(player, inHand); + if (McMMO.repairManager.isRepairable(inHand)) { + McMMO.repairManager.handleRepair(player, inHand); event.setCancelled(true); player.updateInventory(); } diff --git a/src/main/java/com/gmail/nossr50/listeners/SpoutListener.java b/src/main/java/com/gmail/nossr50/listeners/SpoutListener.java index 2add0fd8f..d194f2141 100644 --- a/src/main/java/com/gmail/nossr50/listeners/SpoutListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/SpoutListener.java @@ -10,7 +10,7 @@ import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent; import org.getspout.spoutapi.gui.ScreenType; import org.getspout.spoutapi.player.SpoutPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.datatypes.HUDType; import com.gmail.nossr50.datatypes.HUDmmo; @@ -23,9 +23,9 @@ import com.gmail.nossr50.spout.SpoutStuff; import com.gmail.nossr50.util.Users; public class SpoutListener implements Listener { - private final mcMMO plugin; + private final McMMO plugin; - public SpoutListener(mcMMO plugin) { + public SpoutListener(McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/listeners/WorldListener.java b/src/main/java/com/gmail/nossr50/listeners/WorldListener.java index 507ceeea4..cf1c23271 100644 --- a/src/main/java/com/gmail/nossr50/listeners/WorldListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/WorldListener.java @@ -10,7 +10,7 @@ import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.event.world.WorldSaveEvent; import org.bukkit.event.world.WorldUnloadEvent; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public class WorldListener implements Listener { @EventHandler @@ -23,21 +23,21 @@ public class WorldListener implements Listener { @EventHandler public void onWorldUnload(WorldUnloadEvent event) { - mcMMO.placeStore.unloadWorld(event.getWorld()); + McMMO.placeStore.unloadWorld(event.getWorld()); } @EventHandler public void onWorldSave(WorldSaveEvent event) { - mcMMO.placeStore.saveWorld(event.getWorld()); + McMMO.placeStore.saveWorld(event.getWorld()); } @EventHandler public void onChunkLoad(ChunkLoadEvent event) { - mcMMO.placeStore.chunkLoaded(event.getChunk().getX(), event.getChunk().getZ(), event.getChunk().getWorld()); + McMMO.placeStore.chunkLoaded(event.getChunk().getX(), event.getChunk().getZ(), event.getChunk().getWorld()); } @EventHandler public void onChunkUnload(ChunkUnloadEvent event) { - mcMMO.placeStore.chunkUnloaded(event.getChunk().getX(), event.getChunk().getZ(), event.getChunk().getWorld()); + McMMO.placeStore.chunkUnloaded(event.getChunk().getX(), event.getChunk().getZ(), event.getChunk().getWorld()); } } diff --git a/src/main/java/com/gmail/nossr50/party/Party.java b/src/main/java/com/gmail/nossr50/party/Party.java index 9a3490c94..61b9dd4d5 100644 --- a/src/main/java/com/gmail/nossr50/party/Party.java +++ b/src/main/java/com/gmail/nossr50/party/Party.java @@ -16,7 +16,7 @@ import java.util.Map; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Users; @@ -31,11 +31,11 @@ public class Party { HashMap partyLocks = new HashMap(); HashMap partyPasswords = new HashMap(); - private static mcMMO plugin; + private static McMMO plugin; private static volatile Party instance; private Party() { - plugin = mcMMO.p; + plugin = McMMO.p; pluginPath = plugin.getDataFolder().getPath(); partyPlayersFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPlayers"; partyLocksFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyLocks"; @@ -168,7 +168,7 @@ public class Party { * @return the list of parties. */ public ArrayList getParties() { - String location = mcMMO.usersFile; + String location = McMMO.usersFile; ArrayList parties = new ArrayList(); try { diff --git a/src/main/java/com/gmail/nossr50/runnables/BleedTimer.java b/src/main/java/com/gmail/nossr50/runnables/BleedTimer.java index 18e0f86e9..69d8c7305 100644 --- a/src/main/java/com/gmail/nossr50/runnables/BleedTimer.java +++ b/src/main/java/com/gmail/nossr50/runnables/BleedTimer.java @@ -9,7 +9,7 @@ import java.util.Map.Entry; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Combat; @@ -71,7 +71,7 @@ public class BleedTimer implements Runnable { private void updateBleedList() { if (lock) { - mcMMO.p.getLogger().warning("mcBleedTimer attempted to update the bleedList but the list was locked!"); + McMMO.p.getLogger().warning("mcBleedTimer attempted to update the bleedList but the list was locked!"); } else { bleedList.keySet().removeAll(bleedRemoveList); diff --git a/src/main/java/com/gmail/nossr50/runnables/SQLConversionTask.java b/src/main/java/com/gmail/nossr50/runnables/SQLConversionTask.java index 93ab74aa1..b0418b038 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SQLConversionTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/SQLConversionTask.java @@ -3,21 +3,21 @@ package com.gmail.nossr50.runnables; import java.io.BufferedReader; import java.io.FileReader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.util.Misc; public class SQLConversionTask implements Runnable { - private final mcMMO plugin; + private final McMMO plugin; private String tablePrefix = Config.getInstance().getMySQLTablePrefix(); - public SQLConversionTask(mcMMO plugin) { + public SQLConversionTask(McMMO plugin) { this.plugin = plugin; } @Override public void run() { - String location = mcMMO.usersFile; + String location = McMMO.usersFile; try { FileReader file = new FileReader(location); @@ -164,7 +164,7 @@ public class SQLConversionTask implements Runnable { } //Check to see if the user is in the DB - id = mcMMO.database.getInt("SELECT id FROM " + id = McMMO.database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'"); @@ -172,11 +172,11 @@ public class SQLConversionTask implements Runnable { theCount++; //Update the skill values - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "users SET lastlogin = " + 0 + " WHERE id = " + id); - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "skills SET " + " taming = taming+" + Misc.getInt(taming) @@ -192,7 +192,7 @@ public class SQLConversionTask implements Runnable { + ", acrobatics = acrobatics+" + Misc.getInt(acrobatics) + ", fishing = fishing+" + Misc.getInt(fishing) + " WHERE user_id = " + id); - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "experience SET " + " taming = " + Misc.getInt(tamingXP) @@ -213,32 +213,32 @@ public class SQLConversionTask implements Runnable { theCount++; //Create the user in the DB - mcMMO.database.write("INSERT INTO " + McMMO.database.write("INSERT INTO " + tablePrefix + "users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 + ")"); - id = mcMMO.database.getInt("SELECT id FROM " + id = McMMO.database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'"); - mcMMO.database.write("INSERT INTO " + McMMO.database.write("INSERT INTO " + tablePrefix + "skills (user_id) VALUES (" + id + ")"); - mcMMO.database.write("INSERT INTO " + McMMO.database.write("INSERT INTO " + tablePrefix + "experience (user_id) VALUES (" + id + ")"); //Update the skill values - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "users SET lastlogin = " + 0 + " WHERE id = " + id); - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "users SET party = '" + party + "' WHERE id = " + id); - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "skills SET " + " taming = taming+" + Misc.getInt(taming) @@ -254,7 +254,7 @@ public class SQLConversionTask implements Runnable { + ", acrobatics = acrobatics+" + Misc.getInt(acrobatics) + ", fishing = fishing+" + Misc.getInt(fishing) + " WHERE user_id = " + id); - mcMMO.database.write("UPDATE " + McMMO.database.write("UPDATE " + tablePrefix + "experience SET " + " taming = " + Misc.getInt(tamingXP) diff --git a/src/main/java/com/gmail/nossr50/runnables/SQLReconnect.java b/src/main/java/com/gmail/nossr50/runnables/SQLReconnect.java index 4beb7eae2..9b1168c2c 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SQLReconnect.java +++ b/src/main/java/com/gmail/nossr50/runnables/SQLReconnect.java @@ -2,15 +2,15 @@ package com.gmail.nossr50.runnables; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.util.Database; import com.gmail.nossr50.util.Users; public class SQLReconnect implements Runnable { - private final mcMMO plugin; + private final McMMO plugin; - public SQLReconnect(mcMMO plugin) { + public SQLReconnect(McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/runnables/SaveTimer.java b/src/main/java/com/gmail/nossr50/runnables/SaveTimer.java index 0e2df779d..5298f4a10 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SaveTimer.java +++ b/src/main/java/com/gmail/nossr50/runnables/SaveTimer.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.runnables; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public class SaveTimer implements Runnable { - private final mcMMO plugin; + private final McMMO plugin; - public SaveTimer(final mcMMO plugin) { + public SaveTimer(final McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java b/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java index 7f24cd3a8..bbe4540a6 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java +++ b/src/main/java/com/gmail/nossr50/runnables/SkillMonitor.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.runnables; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -10,9 +10,9 @@ import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class SkillMonitor implements Runnable { - private final mcMMO plugin; + private final McMMO plugin; - public SkillMonitor(final mcMMO plugin) { + public SkillMonitor(final McMMO plugin) { this.plugin = plugin; } diff --git a/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java b/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java index a5655173b..83b5305b4 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java +++ b/src/main/java/com/gmail/nossr50/runnables/SpoutStart.java @@ -3,28 +3,28 @@ package com.gmail.nossr50.runnables; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.player.FileManager; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.spout.SpoutStuff; public class SpoutStart implements Runnable{ - private final mcMMO plugin; + private final McMMO plugin; - public SpoutStart(final mcMMO plugin) { + public SpoutStart(final McMMO plugin) { this.plugin = plugin; } @Override public void run() { if (plugin.getServer().getPluginManager().getPlugin("Spout") != null) { - mcMMO.spoutEnabled = true; + McMMO.spoutEnabled = true; } else { - mcMMO.spoutEnabled = false; + McMMO.spoutEnabled = false; } //Spout Stuff - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutConfig.getInstance(); SpoutStuff.setupSpoutConfigs(); SpoutStuff.registerCustomEvent(); diff --git a/src/main/java/com/gmail/nossr50/skills/combat/Taming.java b/src/main/java/com/gmail/nossr50/skills/combat/Taming.java index 507fd5ff5..4301d7941 100644 --- a/src/main/java/com/gmail/nossr50/skills/combat/Taming.java +++ b/src/main/java/com/gmail/nossr50/skills/combat/Taming.java @@ -18,7 +18,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -202,7 +202,7 @@ public class Taming { * @param type Type of animal to summon * @param player Player summoning the animal */ - public static void animalSummon(EntityType type, Player player, mcMMO plugin) { + public static void animalSummon(EntityType type, Player player, McMMO plugin) { ItemStack item = player.getItemInHand(); Material summonItem = null; int summonAmount = 0; diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java b/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java index 99f4d6cb4..25c47f96a 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/BlastMining.java @@ -16,7 +16,7 @@ import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.player.PlayerInteractEvent; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -52,7 +52,7 @@ public class BlastMining { blocksDropped.add(temp); Mining.miningDrops(temp); - if (!mcMMO.placeStore.isTrue(temp)) { + if (!McMMO.placeStore.isTrue(temp)) { for (int i = 1 ; i < extraDrops ; i++) { blocksDropped.add(temp); Mining.miningDrops(temp); @@ -159,7 +159,7 @@ public class BlastMining { } for (Block block : xp) { - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { Mining.miningXP(player, block); } } @@ -241,7 +241,7 @@ public class BlastMining { * @param player Player detonating the TNT * @param plugin mcMMO plugin instance */ - public static void detonate(PlayerInteractEvent event, Player player, mcMMO plugin) { + public static void detonate(PlayerInteractEvent event, Player player, McMMO plugin) { PlayerProfile PP = Users.getProfile(player); if (PP.getSkillLevel(SkillType.MINING) < 125) diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java b/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java index a3bb08a55..ba844114a 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.getspout.spoutapi.sound.SoundEffect; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.TreasuresConfig; import com.gmail.nossr50.config.mods.CustomBlocksConfig; @@ -118,15 +118,15 @@ public class Excavation { public static void gigaDrillBreaker(Player player, Block block) { Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage()); - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); - mcMMO.p.getServer().getPluginManager().callEvent(armswing); + McMMO.p.getServer().getPluginManager().callEvent(armswing); Excavation.excavationProcCheck(block, player); Excavation.excavationProcCheck(block, player); } - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); } } diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java index 927f19e5c..6c34189f1 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Herbalism.java @@ -11,7 +11,7 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.mods.CustomBlocksConfig; import com.gmail.nossr50.datatypes.AbilityType; @@ -73,7 +73,7 @@ public class Herbalism { * @param event The event to use for Green Thumb * @param plugin mcMMO plugin instance */ - public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, mcMMO plugin) { + public static void herbalismProcCheck(final Block block, Player player, BlockBreakEvent event, McMMO plugin) { final PlayerProfile PP = Users.getProfile(player); final int MAX_BONUS_LEVEL = 1000; @@ -94,7 +94,7 @@ public class Herbalism { switch (type) { case BROWN_MUSHROOM: case RED_MUSHROOM: - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { mat = Material.getMaterial(id); xp = Config.getInstance().getHerbalismXPMushrooms(); } @@ -105,7 +105,7 @@ public class Herbalism { Block b = block.getRelative(0, y, 0); if (b.getType().equals(Material.CACTUS)) { mat = Material.CACTUS; - if (!mcMMO.placeStore.isTrue(b)) { + if (!McMMO.placeStore.isTrue(b)) { if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { catciDrops++; } @@ -127,7 +127,7 @@ public class Herbalism { break; case MELON_BLOCK: - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { mat = Material.MELON; xp = Config.getInstance().getHerbalismXPMelon(); } @@ -142,7 +142,7 @@ public class Herbalism { case PUMPKIN: case JACK_O_LANTERN: - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { mat = Material.getMaterial(id); xp = Config.getInstance().getHerbalismXPPumpkin(); } @@ -150,7 +150,7 @@ public class Herbalism { case RED_ROSE: case YELLOW_FLOWER: - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { mat = Material.getMaterial(id); xp = Config.getInstance().getHerbalismXPFlowers(); } @@ -161,7 +161,7 @@ public class Herbalism { Block b = block.getRelative(0, y, 0); if (b.getType().equals(Material.SUGAR_CANE_BLOCK)) { mat = Material.SUGAR_CANE; - if (!mcMMO.placeStore.isTrue(b)) { + if (!McMMO.placeStore.isTrue(b)) { if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { caneDrops++; } @@ -172,14 +172,14 @@ public class Herbalism { break; case VINE: - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { mat = type; xp = Config.getInstance().getHerbalismXPVines(); } break; case WATER_LILY: - if (!mcMMO.placeStore.isTrue(block)) { + if (!McMMO.placeStore.isTrue(block)) { mat = type; xp = Config.getInstance().getHerbalismXPLilyPads(); } @@ -299,7 +299,7 @@ public class Herbalism { * @param event The event triggering the ability * @param plugin mcMMO plugin instance */ - private static void greenThumbWheat(Block block, Player player, BlockBreakEvent event, mcMMO plugin) { + private static void greenThumbWheat(Block block, Player player, BlockBreakEvent event, McMMO plugin) { final int MAX_BONUS_LEVEL = 1500; PlayerProfile PP = Users.getProfile(player); diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java index 8dd5f4c99..17b8457bc 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Mining.java @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.getspout.spoutapi.sound.SoundEffect; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -285,7 +285,7 @@ public class Mining { * @param block The block being broken */ public static void miningBlockCheck(Player player, Block block) { - if (mcMMO.placeStore.isTrue(block)) { + if (McMMO.placeStore.isTrue(block)) { return; } @@ -322,16 +322,16 @@ public class Mining { return; } - if (mcMMO.placeStore.isTrue(block)) { + if (McMMO.placeStore.isTrue(block)) { return; } - mcMMO.p.getServer().getPluginManager().callEvent(armswing); + McMMO.p.getServer().getPluginManager().callEvent(armswing); Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss); miningBlockCheck(player, block); - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); } } @@ -367,16 +367,16 @@ public class Mining { case NETHERRACK: case SANDSTONE: case STONE: - if (mcMMO.placeStore.isTrue(block)) { + if (McMMO.placeStore.isTrue(block)) { return; } - mcMMO.p.getServer().getPluginManager().callEvent(armswing); + McMMO.p.getServer().getPluginManager().callEvent(armswing); Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss); miningBlockCheck(player, block); - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); } } diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java index 6c07be74c..26b052bdd 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java @@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.material.Tree; import org.getspout.spoutapi.sound.SoundEffect; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -107,7 +107,7 @@ public class WoodCutting { CustomBlock block = ModChecks.getCustomBlock(x); item = block.getItemDrop(); - if (!mcMMO.placeStore.isTrue(x)) { + if (!McMMO.placeStore.isTrue(x)) { WoodCutting.woodCuttingProcCheck(player, x); xp = block.getXpGain(); } @@ -156,7 +156,7 @@ public class WoodCutting { break; } - if (!mcMMO.placeStore.isTrue(x)) { + if (!McMMO.placeStore.isTrue(x)) { WoodCutting.woodCuttingProcCheck(player, x); switch (species) { @@ -232,7 +232,7 @@ public class WoodCutting { Block zNegative = currentBlock.getRelative(0, 0, -1); Block yPositive = currentBlock.getRelative(0, 1, 0); - if (!mcMMO.placeStore.isTrue(currentBlock)) { + if (!McMMO.placeStore.isTrue(currentBlock)) { if (!isTooAggressive(currentBlock, xPositive) && BlockChecks.treeFellerCompatible(xPositive) && !toBeFelled.contains(xPositive)) { processTreeFelling(xPositive, toBeFelled); } @@ -251,7 +251,7 @@ public class WoodCutting { } if (BlockChecks.treeFellerCompatible(yPositive)) { - if(!mcMMO.placeStore.isTrue(currentBlock) && !toBeFelled.contains(yPositive)) { + if(!McMMO.placeStore.isTrue(currentBlock) && !toBeFelled.contains(yPositive)) { processTreeFelling(yPositive, toBeFelled); } } @@ -351,7 +351,7 @@ public class WoodCutting { int xp = 0; TreeSpecies species = TreeSpecies.getByData(block.getData()); - if (mcMMO.placeStore.isTrue(block)) { + if (McMMO.placeStore.isTrue(block)) { return; } @@ -393,13 +393,13 @@ public class WoodCutting { */ public static void leafBlower(Player player, Block block) { FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); - mcMMO.p.getServer().getPluginManager().callEvent(armswing); + McMMO.p.getServer().getPluginManager().callEvent(armswing); if (Config.getInstance().getWoodcuttingRequiresTool()) { Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage()); } - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); } } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index e93190861..058443f1e 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.player.SpoutPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -45,8 +45,8 @@ public class Repair { Skills.xpProcessing(player, PP, SkillType.REPAIR, dif * 10); //CLANG CLANG - if (mcMMO.spoutEnabled) { - SpoutSounds.playRepairNoise(player, mcMMO.p); + if (McMMO.spoutEnabled) { + SpoutSounds.playRepairNoise(player, McMMO.p); } } @@ -241,7 +241,7 @@ public class Repair { PlayerProfile PP = Users.getProfile(player); if (!PP.getPlacedAnvil()) { - if (mcMMO.spoutEnabled) { + if (McMMO.spoutEnabled) { SpoutPlayer sPlayer = SpoutManager.getPlayer(player); if (sPlayer.isSpoutCraftEnabled()) { diff --git a/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java b/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java index 6df11309d..b4cb2d95a 100644 --- a/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java +++ b/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java @@ -7,7 +7,7 @@ import org.getspout.spoutapi.player.SpoutPlayer; import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundManager; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public class SpoutSounds { @@ -30,7 +30,7 @@ public class SpoutSounds { * * @param player The player who repaired an item */ - public static void playRepairNoise(Player player, mcMMO plugin) { + public static void playRepairNoise(Player player, McMMO plugin) { SoundManager SM = SpoutManager.getSoundManager(); SpoutPlayer sPlayer = SpoutManager.getPlayer(player); @@ -43,7 +43,7 @@ public class SpoutSounds { * * @param player The player who leveled up */ - protected static void playLevelUpNoise(Player player, mcMMO plugin) { + protected static void playLevelUpNoise(Player player, McMMO plugin) { SoundManager SM = SpoutManager.getSoundManager(); SpoutPlayer sPlayer = SpoutManager.getPlayer(player); diff --git a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java index 075d9624b..ea116159f 100644 --- a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java +++ b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java @@ -19,7 +19,7 @@ import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.keyboard.Keyboard; import org.getspout.spoutapi.player.SpoutPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.datatypes.HUDmmo; import com.gmail.nossr50.datatypes.PlayerProfile; @@ -30,9 +30,9 @@ import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Users; public class SpoutStuff { - private static mcMMO plugin = mcMMO.p; + private static McMMO plugin = McMMO.p; - public final static String spoutDirectory = mcMMO.mainDirectory + "Resources" + File.separator; + public final static String spoutDirectory = McMMO.mainDirectory + "Resources" + File.separator; public final static String hudDirectory = spoutDirectory + "HUD" + File.separator; public final static String hudStandardDirectory = hudDirectory + "Standard" + File.separator; public final static String hudRetroDirectory = hudDirectory + "Retro" + File.separator; @@ -55,7 +55,7 @@ public class SpoutStuff { try { File currentFile = new File(theFilePath + theFileName); - JarFile jar = new JarFile(mcMMO.mcmmo); + JarFile jar = new JarFile(McMMO.mcmmo); JarEntry entry = jar.getJarEntry("resources/" + theFileName); InputStream is = jar.getInputStream(entry); diff --git a/src/main/java/com/gmail/nossr50/util/Combat.java b/src/main/java/com/gmail/nossr50/util/Combat.java index 5d3975db4..135a31a0b 100644 --- a/src/main/java/com/gmail/nossr50/util/Combat.java +++ b/src/main/java/com/gmail/nossr50/util/Combat.java @@ -17,7 +17,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.PlayerAnimationEvent; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.PlayerProfile; @@ -315,7 +315,7 @@ public class Combat { private static void dealDamage(LivingEntity target, int dmg, DamageCause cause) { if (configInstance.getEventCallbackEnabled()) { EntityDamageEvent ede = new FakeEntityDamageEvent(target, cause, dmg); - mcMMO.p.getServer().getPluginManager().callEvent(ede); + McMMO.p.getServer().getPluginManager().callEvent(ede); if (ede.isCancelled()) { return; @@ -338,7 +338,7 @@ public class Combat { private static void dealDamage(LivingEntity target, int dmg, Player attacker) { if (configInstance.getEventCallbackEnabled()) { EntityDamageEvent ede = new FakeEntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg); - mcMMO.p.getServer().getPluginManager().callEvent(ede); + McMMO.p.getServer().getPluginManager().callEvent(ede); if (ede.isCancelled()) { return; @@ -383,7 +383,7 @@ public class Combat { } PlayerAnimationEvent armswing = new PlayerAnimationEvent(attacker); - mcMMO.p.getServer().getPluginManager().callEvent(armswing); + McMMO.p.getServer().getPluginManager().callEvent(armswing); if (entity instanceof Player) { Player defender = (Player) entity; @@ -541,7 +541,7 @@ public class Combat { } if (baseXP != 0) { - mcMMO.p.getServer().getScheduler().scheduleSyncDelayedTask(mcMMO.p, new GainXp(attacker, PP, skillType, baseXP, target), 0); + McMMO.p.getServer().getScheduler().scheduleSyncDelayedTask(McMMO.p, new GainXp(attacker, PP, skillType, baseXP, target), 0); } } } diff --git a/src/main/java/com/gmail/nossr50/util/Database.java b/src/main/java/com/gmail/nossr50/util/Database.java index bcbf978f0..279110d7c 100644 --- a/src/main/java/com/gmail/nossr50/util/Database.java +++ b/src/main/java/com/gmail/nossr50/util/Database.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Properties; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.DatabaseUpdate; import com.gmail.nossr50.runnables.SQLReconnect; @@ -19,10 +19,10 @@ public class Database { private static String connectionString = "jdbc:mysql://" + Config.getInstance().getMySQLServerName() + ":" + Config.getInstance().getMySQLServerPort() + "/" + Config.getInstance().getMySQLDatabaseName() + "?user=" + Config.getInstance().getMySQLUserName() + "&password=" + Config.getInstance().getMySQLUserPassword(); private static String tablePrefix = Config.getInstance().getMySQLTablePrefix(); private static Connection conn = null; - private static mcMMO plugin = null; + private static McMMO plugin = null; private static long reconnectTimestamp = 0; - public Database(mcMMO instance) { + public Database(McMMO instance) { plugin = instance; connect(); //Connect to MySQL diff --git a/src/main/java/com/gmail/nossr50/util/ItemChecks.java b/src/main/java/com/gmail/nossr50/util/ItemChecks.java index 429d5e8d5..63e61e646 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemChecks.java +++ b/src/main/java/com/gmail/nossr50/util/ItemChecks.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.util; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.api.SpoutToolsAPI; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.mods.CustomArmorConfig; @@ -32,7 +32,7 @@ public class ItemChecks { if (customToolsEnabled && CustomToolsConfig.getInstance().customSwordIDs.contains(is.getTypeId())) { return true; } - else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutSwords.contains(is)) { + else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutSwords.contains(is)) { return true; } else { @@ -60,7 +60,7 @@ public class ItemChecks { if (customToolsEnabled && CustomToolsConfig.getInstance().customHoeIDs.contains(is.getTypeId())) { return true; } - else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutHoes.contains(is)) { + else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutHoes.contains(is)) { return true; } else { @@ -88,7 +88,7 @@ public class ItemChecks { if (customToolsEnabled && CustomToolsConfig.getInstance().customShovelIDs.contains(is.getTypeId())) { return true; } - else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutShovels.contains(is)) { + else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutShovels.contains(is)) { return true; } else { @@ -116,7 +116,7 @@ public class ItemChecks { if (customToolsEnabled && CustomToolsConfig.getInstance().customAxeIDs.contains(is.getTypeId())) { return true; } - else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutAxes.contains(is)) { + else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutAxes.contains(is)) { return true; } else { @@ -144,7 +144,7 @@ public class ItemChecks { if (customToolsEnabled && CustomToolsConfig.getInstance().customPickaxeIDs.contains(is.getTypeId())) { return true; } - else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutPickaxes.contains(is)) { + else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutPickaxes.contains(is)) { return true; } else { diff --git a/src/main/java/com/gmail/nossr50/util/Leaderboard.java b/src/main/java/com/gmail/nossr50/util/Leaderboard.java index 1a1372f62..02cc257b6 100644 --- a/src/main/java/com/gmail/nossr50/util/Leaderboard.java +++ b/src/main/java/com/gmail/nossr50/util/Leaderboard.java @@ -7,16 +7,16 @@ import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.PlayerStat; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.Tree; public class Leaderboard { - private static mcMMO plugin = mcMMO.p; - private static String leaderboardsDirectory = mcMMO.leaderboardDirectory; - private final static String location = mcMMO.usersFile; + private static McMMO plugin = McMMO.p; + private static String leaderboardsDirectory = McMMO.leaderboardDirectory; + private final static String location = McMMO.usersFile; /** * Create the leaderboards. diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index 0dd5a6429..c2d843f16 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -11,7 +11,7 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.PluginManager; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; @@ -110,10 +110,10 @@ public class Misc { //Support for NoCheat if (shouldArmSwing) { FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); - mcMMO.p.getServer().getPluginManager().callEvent(armswing); + McMMO.p.getServer().getPluginManager().callEvent(armswing); } - PluginManager pluginManger = mcMMO.p.getServer().getPluginManager(); + PluginManager pluginManger = McMMO.p.getServer().getPluginManager(); FakeBlockDamageEvent damageEvent = new FakeBlockDamageEvent(player, block, player.getItemInHand(), true); pluginManger.callEvent(damageEvent); @@ -247,7 +247,7 @@ public class Misc { // We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event. McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack); - mcMMO.p.getServer().getPluginManager().callEvent(event); + McMMO.p.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; diff --git a/src/main/java/com/gmail/nossr50/util/Skills.java b/src/main/java/com/gmail/nossr50/util/Skills.java index b771ff0be..2ff3b5103 100644 --- a/src/main/java/com/gmail/nossr50/util/Skills.java +++ b/src/main/java/com/gmail/nossr50/util/Skills.java @@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.player.SpoutPlayer; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.datatypes.AbilityType; @@ -194,7 +194,7 @@ public class Skills { profile.skillUp(skillType, 1); McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType); - mcMMO.p.getServer().getPluginManager().callEvent(eventToFire); + McMMO.p.getServer().getPluginManager().callEvent(eventToFire); } else { profile.addLevels(skillType, 0); @@ -209,7 +209,7 @@ public class Skills { String capitalized = Misc.getCapitalized(skillType.toString()); /* Spout Stuff */ - if (mcMMO.spoutEnabled && player instanceof SpoutPlayer) { + if (McMMO.spoutEnabled && player instanceof SpoutPlayer) { SpoutPlayer sPlayer = SpoutManager.getPlayer(player); if (sPlayer.isSpoutCraftEnabled()) { @@ -234,7 +234,7 @@ public class Skills { } /* Always update XP Bar (Check if no levels were gained first to remove redundancy) */ - if (skillups == 0 && mcMMO.spoutEnabled && player instanceof SpoutPlayer) { + if (skillups == 0 && McMMO.spoutEnabled && player instanceof SpoutPlayer) { SpoutPlayer sPlayer = (SpoutPlayer) player; if (sPlayer.isSpoutCraftEnabled()) { if (SpoutConfig.getInstance().getXPBarEnabled()) { diff --git a/src/main/java/com/gmail/nossr50/util/Users.java b/src/main/java/com/gmail/nossr50/util/Users.java index c6642bc2c..ff257e8e0 100644 --- a/src/main/java/com/gmail/nossr50/util/Users.java +++ b/src/main/java/com/gmail/nossr50/util/Users.java @@ -8,7 +8,7 @@ import java.util.HashMap; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.datatypes.PlayerProfile; public class Users { @@ -18,10 +18,10 @@ public class Users { * Load users. */ public static void loadUsers() { - new File(mcMMO.flatFileDirectory).mkdir(); - new File(mcMMO.leaderboardDirectory).mkdir(); + new File(McMMO.flatFileDirectory).mkdir(); + new File(McMMO.leaderboardDirectory).mkdir(); - File theDir = new File(mcMMO.usersFile); + File theDir = new File(McMMO.usersFile); if (!theDir.exists()) { try { @@ -79,7 +79,7 @@ public class Users { * @param playerName The name of the player to remove */ public static void removeUserByName(String playerName) { - players.remove(mcMMO.p.getServer().getOfflinePlayer(playerName)); + players.remove(McMMO.p.getServer().getOfflinePlayer(playerName)); } /** @@ -99,7 +99,7 @@ public class Users { * @return the player's profile */ public static PlayerProfile getProfileByName(String playerName) { - Player player = mcMMO.p.getServer().getPlayer(playerName); + Player player = McMMO.p.getServer().getPlayer(playerName); PlayerProfile profile = players.get(player); if (profile == null) { @@ -110,7 +110,7 @@ public class Users { return newProfile; } else { - mcMMO.p.getLogger().severe("getProfileByName(" + playerName + ") just returned null :("); + McMMO.p.getLogger().severe("getProfileByName(" + playerName + ") just returned null :("); for (StackTraceElement ste : new Throwable().getStackTrace()) { System.out.println(ste); diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java index bb339b969..760f21eaf 100644 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java @@ -13,7 +13,7 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.block.Block; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; public class HashChunkletManager implements ChunkletManager { private HashMap store = new HashMap(); @@ -229,7 +229,7 @@ public class HashChunkletManager implements ChunkletManager { } catch (IOException ex) { if (ex instanceof EOFException) { // EOF should only happen on Chunklets that somehow have been corrupted. - mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read, data in this are will be lost."); + McMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read, data in this are will be lost."); return ChunkletStoreFactory.getChunkletStore(); } ex.printStackTrace(); diff --git a/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 5b9cdacce..26b82206e 100644 --- a/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -12,18 +12,18 @@ import java.util.zip.Deflater; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.McMMO; import com.gmail.nossr50.config.Config; public class ZipLibrary { - private static String BackupDirectory = mcMMO.mainDirectory + "backup" + File.separator; + private static String BackupDirectory = McMMO.mainDirectory + "backup" + File.separator; private static File BackupDir = new File(BackupDirectory); - private static File FlatFileDirectory = new File(mcMMO.flatFileDirectory); - private static File ModFileDirectory = new File(mcMMO.modDirectory); - private static File UsersFile = new File(mcMMO.usersFile); - private static File ConfigFile = new File(mcMMO.mainDirectory + "config.yml"); - private static File TreasuresFile = new File(mcMMO.mainDirectory + "treasures.yml"); - private static File Leaderboards = new File(mcMMO.leaderboardDirectory); + private static File FlatFileDirectory = new File(McMMO.flatFileDirectory); + private static File ModFileDirectory = new File(McMMO.modDirectory); + private static File UsersFile = new File(McMMO.usersFile); + private static File ConfigFile = new File(McMMO.mainDirectory + "config.yml"); + private static File TreasuresFile = new File(McMMO.mainDirectory + "treasures.yml"); + private static File Leaderboards = new File(McMMO.leaderboardDirectory); public static void mcMMObackup() throws IOException { if (Config.getInstance().getUseMySQL()) { @@ -33,10 +33,10 @@ public class ZipLibrary { try { if (BackupDir.mkdir()) { - mcMMO.p.getLogger().info("Created Backup Directory."); + McMMO.p.getLogger().info("Created Backup Directory."); } } catch (Exception e) { - mcMMO.p.getLogger().severe(e.toString()); + McMMO.p.getLogger().severe(e.toString()); } //Generate the proper date for the backup filename