diff --git a/src/main/java/com/gmail/nossr50/api/ChatAPI.java b/src/main/java/com/gmail/nossr50/api/ChatAPI.java index d72dab8d8..0279f8076 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; @@ -24,7 +24,7 @@ public final class ChatAPI { */ public static 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; @@ -32,9 +32,9 @@ public final 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()); @@ -53,7 +53,7 @@ public final class ChatAPI { */ public static 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; @@ -61,9 +61,9 @@ public final 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 d87c22b0d..062b48443 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 34808e2c1..c7533cf5a 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 c2ba97796..b3bd81f13 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 e98ab4002..4e0f3d679 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 fa0a5d5b8..2f6b4a2b0 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 93b90ce42..502cf0b58 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 bb7bcb304..98661d898 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 0bb7d90f0..fd460cbcd 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 e8b4e8b5b..38f9c1f27 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 33f157dcb..6b5ac3368 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 1079e9b03..6e3517296 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 95b080e58..e18e9aeaf 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 9d1cf8291..89276c60c 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 acf158f8c..a1951cc6a 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 6bba28b3f..6a7283d5a 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 bf9d57759..38c2e8a42 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 2c28922e8..89aab4651 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 cd63e52df..f897af818 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 7ca3d5768..cb2b43e0f 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 fc8b6d5a1..5fdf2035f 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 fb7b611e2..97865fa02 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 3fc9b91e8..bf908205f 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 e70eb5793..36999ee45 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 9c3ceea5f..00cedcdf7 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 2eb27d9ca..25930c1cf 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 945e95fc1..bb4e4179c 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 2b6dd35b4..783a25e83 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 770da8943..0eba9e247 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 ec9ea2c02..cfcab287a 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 6673c03c5..08ad6afa2 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 92d31270d..2259e82c4 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 8f2e94afe..60c525e8b 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 bf4db32f9..e182b5925 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 bd28fda7f..8e82e1335 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 1ac2cc5c3..60949f49f 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 ea4217885..d45558087 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 d194f2141..2add0fd8f 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 cf1c23271..507ceeea4 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/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 6bddc25e6..3d3aa5f9c 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/party/Party.java b/src/main/java/com/gmail/nossr50/party/Party.java index 61b9dd4d5..9a3490c94 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 69d8c7305..18e0f86e9 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 b0418b038..93ab74aa1 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 9b1168c2c..4beb7eae2 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 5298f4a10..0e2df779d 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 bbe4540a6..7f24cd3a8 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 83b5305b4..a5655173b 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 4301d7941..507fd5ff5 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 204488c2e..e793ada50 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 ba844114a..a3bb08a55 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 6c34189f1..927f19e5c 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 17b8457bc..8dd5f4c99 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 26b052bdd..6c07be74c 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 058443f1e..e93190861 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/skills/repair/SimpleRepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java index ec73a1d46..e166bf244 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java @@ -205,6 +205,19 @@ public class SimpleRepairManager implements RepairManager { ItemStack[] contents = inventory.getContents(); for (int i = 0; i < contents.length; i++) { ItemStack item = contents[i]; + + //DEBUG TIME! + if (item == null) { + System.out.println("The item is null."); + System.out.println("Content length: " + contents.length); + System.out.println("Current contents: " + i); + } + else { + System.out.println("The item is: " + item.toString()); + System.out.println("Content length: " + contents.length); + System.out.println("Current contents: " + i); + } + if (item.getTypeId() == itemId) { if (item.getData().getData() == metadata) { location = i; diff --git a/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java b/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java index b4cb2d95a..6df11309d 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 ea116159f..075d9624b 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 135a31a0b..5d3975db4 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 279110d7c..bcbf978f0 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 63e61e646..429d5e8d5 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 02cc257b6..1a1372f62 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 c2d843f16..0dd5a6429 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 2ff3b5103..b771ff0be 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 ff257e8e0..c6642bc2c 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 760f21eaf..bb339b969 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 26b82206e..5b9cdacce 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