Because making it upper case broke all the things.

This commit is contained in:
GJ 2012-06-06 18:02:22 -04:00
parent 0a44a74f59
commit 2f15c71412
66 changed files with 318 additions and 305 deletions

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.api;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; 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.McMMOAdminChatEvent;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@ -24,7 +24,7 @@ public final class ChatAPI {
*/ */
public static void sendPartyChat(String sender, String party, String message) { public static void sendPartyChat(String sender, String party, String message) {
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(sender, party, message); McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(sender, party, message);
McMMO.p.getServer().getPluginManager().callEvent(chatEvent); mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
if (chatEvent.isCancelled()) { if (chatEvent.isCancelled()) {
return; return;
@ -32,9 +32,9 @@ public final class ChatAPI {
String pPrefix = ChatColor.GREEN + "(" + ChatColor.WHITE + chatEvent.getSender() + ChatColor.GREEN + ") "; 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).inParty()) {
if (Users.getProfile(player).getParty().equalsIgnoreCase(chatEvent.getParty())) { if (Users.getProfile(player).getParty().equalsIgnoreCase(chatEvent.getParty())) {
player.sendMessage(pPrefix + chatEvent.getMessage()); player.sendMessage(pPrefix + chatEvent.getMessage());
@ -53,7 +53,7 @@ public final class ChatAPI {
*/ */
public static void sendAdminChat(String sender, String message) { public static void sendAdminChat(String sender, String message) {
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(sender, message); McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(sender, message);
McMMO.p.getServer().getPluginManager().callEvent(chatEvent); mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
if (chatEvent.isCancelled()) { if (chatEvent.isCancelled()) {
return; return;
@ -61,9 +61,9 @@ public final class ChatAPI {
String aPrefix = ChatColor.AQUA + "{" + ChatColor.WHITE + chatEvent.getSender() + ChatColor.AQUA + "} "; 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()) if (Permissions.getInstance().adminChat(player) || player.isOp())
player.sendMessage(aPrefix + chatEvent.getMessage()); player.sendMessage(aPrefix + chatEvent.getMessage());
} }

View File

@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -17,9 +17,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class AddlevelsCommand implements CommandExecutor{ public class AddlevelsCommand implements CommandExecutor{
private final McMMO plugin; private final mcMMO plugin;
public AddlevelsCommand (McMMO plugin) { public AddlevelsCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; 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? //TODO: Any way we can make this work for offline use?
public class AddxpCommand implements CommandExecutor { public class AddxpCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public AddxpCommand (McMMO plugin) { public AddxpCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -16,9 +16,9 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class InspectCommand implements CommandExecutor { public class InspectCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public InspectCommand (McMMO plugin) { public InspectCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -17,9 +17,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class MmoeditCommand implements CommandExecutor { public class MmoeditCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public MmoeditCommand (McMMO plugin) { public MmoeditCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -6,16 +6,16 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.runnables.SQLConversionTask; import com.gmail.nossr50.runnables.SQLConversionTask;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class MmoupdateCommand implements CommandExecutor { public class MmoupdateCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public MmoupdateCommand (McMMO plugin) { public MmoupdateCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -5,18 +5,18 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
public class XprateCommand implements CommandExecutor { public class XprateCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
private static int oldrate = Config.getInstance().xpGainMultiplier; private static int oldrate = Config.getInstance().xpGainMultiplier;
public static boolean xpevent = false; public static boolean xpevent = false;
public XprateCommand (McMMO plugin) { public XprateCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -7,7 +7,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.getspout.spoutapi.player.SpoutPlayer; 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.Config;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@ -19,7 +19,7 @@ public class McmmoCommand implements CommandExecutor {
sender.sendMessage(mcSplit); sender.sendMessage(mcSplit);
if (Config.getInstance().getDonateMessageEnabled()) { if (Config.getInstance().getDonateMessageEnabled()) {
if (McMMO.spoutEnabled && sender instanceof SpoutPlayer) { if (mcMMO.spoutEnabled && sender instanceof SpoutPlayer) {
SpoutPlayer sPlayer = (SpoutPlayer) sender; SpoutPlayer sPlayer = (SpoutPlayer) sender;
sPlayer.sendNotification(ChatColor.YELLOW + "[mcMMO]" + ChatColor.GOLD + " Donate!", ChatColor.GREEN + "mcmmodev@gmail.com", Material.DIAMOND); sPlayer.sendNotification(ChatColor.YELLOW + "[mcMMO]" + ChatColor.GOLD + " Donate!", ChatColor.GREEN + "mcmmodev@gmail.com", Material.DIAMOND);

View File

@ -7,16 +7,16 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class McrefreshCommand implements CommandExecutor { public class McrefreshCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public McrefreshCommand(McMMO instance) { public McrefreshCommand(mcMMO instance) {
this.plugin = instance; this.plugin = instance;
} }

View File

@ -10,7 +10,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@ -18,11 +18,11 @@ import com.gmail.nossr50.util.Users;
public class McremoveCommand implements CommandExecutor { public class McremoveCommand implements CommandExecutor {
private final String location; private final String location;
private final McMMO plugin; private final mcMMO plugin;
public McremoveCommand (McMMO plugin) { public McremoveCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
this.location = McMMO.usersFile; this.location = mcMMO.usersFile;
} }
@Override @Override
@ -51,30 +51,30 @@ public class McremoveCommand implements CommandExecutor {
/* MySQL */ /* MySQL */
if (Config.getInstance().getUseMySQL()) { if (Config.getInstance().getUseMySQL()) {
int userId = 0; 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) { if (userId > 0) {
McMMO.database.write("DELETE FROM " mcMMO.database.write("DELETE FROM "
+ databaseName + "." + databaseName + "."
+ tablePrefix + "users WHERE " + tablePrefix + "users WHERE "
+ tablePrefix + "users.id=" + userId); + tablePrefix + "users.id=" + userId);
McMMO.database.write("DELETE FROM " mcMMO.database.write("DELETE FROM "
+ databaseName + "." + databaseName + "."
+ tablePrefix + "cooldowns WHERE " + tablePrefix + "cooldowns WHERE "
+ tablePrefix + "cooldowns.user_id=" + userId); + tablePrefix + "cooldowns.user_id=" + userId);
McMMO.database.write("DELETE FROM " mcMMO.database.write("DELETE FROM "
+ databaseName + "." + databaseName + "."
+ tablePrefix + "huds WHERE " + tablePrefix + "huds WHERE "
+ tablePrefix + "huds.user_id=" + userId); + tablePrefix + "huds.user_id=" + userId);
McMMO.database.write("DELETE FROM " mcMMO.database.write("DELETE FROM "
+ databaseName + "." + databaseName + "."
+ tablePrefix + "skills WHERE " + tablePrefix + "skills WHERE "
+ tablePrefix + "skills.user_id=" + userId); + tablePrefix + "skills.user_id=" + userId);
McMMO.database.write("DELETE FROM " mcMMO.database.write("DELETE FROM "
+ databaseName + "." + databaseName + "."
+ tablePrefix + "experience WHERE " + tablePrefix + "experience WHERE "
+ tablePrefix + "experience.user_id=" + userId); + tablePrefix + "experience.user_id=" + userId);

View File

@ -8,7 +8,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; 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.config.Config;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Leaderboard; import com.gmail.nossr50.util.Leaderboard;
@ -134,7 +134,7 @@ public class MctopCommand implements CommandExecutor {
private void sqlDisplay(int page, String query, CommandSender sender) { private void sqlDisplay(int page, String query, CommandSender sender) {
String tablePrefix = Config.getInstance().getMySQLTablePrefix(); String tablePrefix = Config.getInstance().getMySQLTablePrefix();
HashMap<Integer, ArrayList<String>> userslist = McMMO.database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC "); HashMap<Integer, ArrayList<String>> 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") { if (query == "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing") {
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); 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++) { 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; break;
} }
HashMap<Integer, ArrayList<String>> username = McMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); HashMap<Integer, ArrayList<String>> 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)); sender.sendMessage(String.valueOf(i) + ". " + ChatColor.GREEN + userslist.get(i).get(0) + " - " + ChatColor.WHITE + username.get(1).get(0));
} }
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
@ -15,9 +15,9 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class ACommand implements CommandExecutor { public class ACommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public ACommand (McMMO plugin) { public ACommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -5,7 +5,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
@ -15,9 +15,9 @@ import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class AcceptCommand implements CommandExecutor { public class AcceptCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public AcceptCommand (McMMO plugin) { public AcceptCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
@ -15,9 +15,9 @@ import com.gmail.nossr50.util.Users;
//TODO: Make this work from console. //TODO: Make this work from console.
public class InviteCommand implements CommandExecutor { public class InviteCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public InviteCommand(McMMO instance) { public InviteCommand(mcMMO instance) {
this.plugin = instance; this.plugin = instance;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
@ -15,9 +15,9 @@ import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PCommand implements CommandExecutor { public class PCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public PCommand (McMMO plugin) { public PCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
@ -16,9 +16,9 @@ import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PartyCommand implements CommandExecutor { public class PartyCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public PartyCommand (McMMO plugin) { public PartyCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
@ -16,9 +16,9 @@ import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PtpCommand implements CommandExecutor { public class PtpCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public PtpCommand(McMMO instance) { public PtpCommand(mcMMO instance) {
this.plugin = instance; this.plugin = instance;
} }

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.commands.skills; 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.commands.SkillCommand;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -36,10 +36,10 @@ public class RepairCommand extends SkillCommand {
@Override @Override
protected void dataCalculations() { protected void dataCalculations() {
// We're using pickaxes here, not the best but it works // We're using pickaxes here, not the best but it works
Repairable diamondRepairable = McMMO.repairManager.getRepairable(278); Repairable diamondRepairable = mcMMO.repairManager.getRepairable(278);
Repairable goldRepairable = McMMO.repairManager.getRepairable(285); Repairable goldRepairable = mcMMO.repairManager.getRepairable(285);
Repairable ironRepairable = McMMO.repairManager.getRepairable(257); Repairable ironRepairable = mcMMO.repairManager.getRepairable(257);
Repairable stoneRepairable = McMMO.repairManager.getRepairable(274); Repairable stoneRepairable = mcMMO.repairManager.getRepairable(274);
diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel(); diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel();
goldLevel = (goldRepairable == null) ? 0 : goldRepairable.getMinimumLevel(); goldLevel = (goldRepairable == null) ? 0 : goldRepairable.getMinimumLevel();

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.config.SpoutConfig;
import com.gmail.nossr50.datatypes.HUDType; import com.gmail.nossr50.datatypes.HUDType;
@ -17,9 +17,9 @@ import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class MchudCommand implements CommandExecutor { public class MchudCommand implements CommandExecutor {
private final McMMO plugin; private final mcMMO plugin;
public MchudCommand (McMMO plugin) { public MchudCommand (mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }
@ -32,7 +32,7 @@ public class MchudCommand implements CommandExecutor {
return true; return true;
} }
if (!McMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled()) { if (!mcMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled()) {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled")); sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true; return true;
} }

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; 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.commands.CommandHelper;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.config.SpoutConfig;
@ -28,7 +28,7 @@ public class XplockCommand implements CommandExecutor {
return true; 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")); sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true; return true;
} }

View File

@ -5,7 +5,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public class Config extends ConfigLoader { public class Config extends ConfigLoader {
public int xpGainMultiplier = 1; public int xpGainMultiplier = 1;
@ -13,7 +13,7 @@ public class Config extends ConfigLoader {
public static Config getInstance() { public static Config getInstance() {
if (instance == null) { if (instance == null) {
instance = new Config(McMMO.p); instance = new Config(mcMMO.p);
instance.load(); instance.load();
} }
@ -375,7 +375,7 @@ public class Config extends ConfigLoader {
* CONFIG LOADING * CONFIG LOADING
*/ */
private Config(McMMO plugin) { private Config(mcMMO plugin) {
super(plugin, "config.yml"); super(plugin, "config.yml");
saveIfNotExist(); saveIfNotExist();
xpGainMultiplier = getExperienceGainsGlobalMultiplier(); xpGainMultiplier = getExperienceGainsGlobalMultiplier();

View File

@ -6,16 +6,16 @@ import java.io.IOException;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public abstract class ConfigLoader { public abstract class ConfigLoader {
protected String fileName; protected String fileName;
protected File configFile; protected File configFile;
protected File dataFolder; protected File dataFolder;
protected final McMMO plugin; protected final mcMMO plugin;
protected FileConfiguration config; protected FileConfiguration config;
public ConfigLoader(McMMO plugin, String fileName){ public ConfigLoader(mcMMO plugin, String fileName){
this.plugin = plugin; this.plugin = plugin;
this.fileName = fileName; this.fileName = fileName;
dataFolder = plugin.getDataFolder(); dataFolder = plugin.getDataFolder();

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.config;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public class HiddenConfig extends ConfigLoader { public class HiddenConfig extends ConfigLoader {
private static String fileName; private static String fileName;
@ -11,7 +11,7 @@ public class HiddenConfig extends ConfigLoader {
private static boolean chunkletsEnabled; private static boolean chunkletsEnabled;
public HiddenConfig(McMMO plugin, String fileName) { public HiddenConfig(mcMMO plugin, String fileName) {
super(plugin, fileName); super(plugin, fileName);
HiddenConfig.fileName = fileName; HiddenConfig.fileName = fileName;
} }
@ -19,7 +19,7 @@ public class HiddenConfig extends ConfigLoader {
public static HiddenConfig getInstance() { public static HiddenConfig getInstance() {
if (instance == null) { if (instance == null) {
instance = new HiddenConfig(McMMO.p, "hidden.yml"); instance = new HiddenConfig(mcMMO.p, "hidden.yml");
instance.load(); instance.load();
} }

View File

@ -7,7 +7,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration; 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.RepairItemType;
import com.gmail.nossr50.skills.repair.RepairMaterialType; import com.gmail.nossr50.skills.repair.RepairMaterialType;
import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.Repairable;
@ -16,7 +16,7 @@ import com.gmail.nossr50.skills.repair.RepairableFactory;
public class RepairConfig extends ConfigLoader { public class RepairConfig extends ConfigLoader {
private List<Repairable> repairables; private List<Repairable> repairables;
public RepairConfig(McMMO plugin, String fileName) { public RepairConfig(mcMMO plugin, String fileName) {
super(plugin, fileName); super(plugin, fileName);
this.config = YamlConfiguration.loadConfiguration(this.configFile); this.config = YamlConfiguration.loadConfiguration(this.configFile);
} }

View File

@ -5,13 +5,13 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.Repairable;
public class RepairConfigManager { public class RepairConfigManager {
private List<Repairable> repairables; private List<Repairable> repairables;
public RepairConfigManager(McMMO plugin) { public RepairConfigManager(mcMMO plugin) {
repairables = new ArrayList<Repairable>(); repairables = new ArrayList<Repairable>();
Pattern pattern = Pattern.compile("repair\\.(?:.+)\\.yml"); Pattern pattern = Pattern.compile("repair\\.(?:.+)\\.yml");

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.config; package com.gmail.nossr50.config;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.HUDType; import com.gmail.nossr50.datatypes.HUDType;
public class SpoutConfig extends ConfigLoader { public class SpoutConfig extends ConfigLoader {
@ -8,7 +8,7 @@ public class SpoutConfig extends ConfigLoader {
public static SpoutConfig getInstance() { public static SpoutConfig getInstance() {
if (instance == null) { if (instance == null) {
instance = new SpoutConfig(McMMO.p); instance = new SpoutConfig(mcMMO.p);
instance.load(); instance.load();
} }
@ -17,7 +17,7 @@ public class SpoutConfig extends ConfigLoader {
public HUDType defaulthud; public HUDType defaulthud;
private SpoutConfig(McMMO plugin) { private SpoutConfig(mcMMO plugin) {
super(plugin, "spout.yml"); super(plugin, "spout.yml");
saveIfNotExist(); saveIfNotExist();
} }

View File

@ -11,7 +11,7 @@ import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack; 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.ExcavationTreasure;
import com.gmail.nossr50.datatypes.treasure.FishingTreasure; import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
import com.gmail.nossr50.datatypes.treasure.Treasure; import com.gmail.nossr50.datatypes.treasure.Treasure;
@ -21,7 +21,7 @@ public class TreasuresConfig extends ConfigLoader{
public static TreasuresConfig getInstance() { public static TreasuresConfig getInstance() {
if (instance == null) { if (instance == null) {
instance = new TreasuresConfig(McMMO.p); instance = new TreasuresConfig(mcMMO.p);
instance.load(); instance.load();
} }
@ -41,7 +41,7 @@ public class TreasuresConfig extends ConfigLoader{
public List<FishingTreasure> fishingRewardsTier4 = new ArrayList<FishingTreasure>(); public List<FishingTreasure> fishingRewardsTier4 = new ArrayList<FishingTreasure>();
public List<FishingTreasure> fishingRewardsTier5 = new ArrayList<FishingTreasure>(); public List<FishingTreasure> fishingRewardsTier5 = new ArrayList<FishingTreasure>();
private TreasuresConfig(McMMO plugin) { private TreasuresConfig(mcMMO plugin) {
super(plugin, "treasures.yml"); super(plugin, "treasures.yml");
saveIfNotExist(); saveIfNotExist();
} }

View File

@ -8,7 +8,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection; 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.datatypes.mods.CustomItem;
import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.Repairable;
import com.gmail.nossr50.skills.repair.RepairableFactory; import com.gmail.nossr50.skills.repair.RepairableFactory;
@ -18,7 +18,7 @@ public class CustomArmorConfig extends ModConfigLoader{
public static CustomArmorConfig getInstance() { public static CustomArmorConfig getInstance() {
if (instance == null) { if (instance == null) {
instance = new CustomArmorConfig(McMMO.p); instance = new CustomArmorConfig(mcMMO.p);
} }
return instance; return instance;
@ -35,7 +35,7 @@ public class CustomArmorConfig extends ModConfigLoader{
public List<CustomItem> customArmorList = new ArrayList<CustomItem>(); public List<CustomItem> customArmorList = new ArrayList<CustomItem>();
public HashMap<Integer, CustomItem> customArmor = new HashMap<Integer, CustomItem>(); public HashMap<Integer, CustomItem> customArmor = new HashMap<Integer, CustomItem>();
public CustomArmorConfig(McMMO plugin) { public CustomArmorConfig(mcMMO plugin) {
super(plugin, "armor.yml"); super(plugin, "armor.yml");
} }

View File

@ -8,7 +8,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.mods.CustomBlock; import com.gmail.nossr50.datatypes.mods.CustomBlock;
public class CustomBlocksConfig extends ModConfigLoader{ public class CustomBlocksConfig extends ModConfigLoader{
@ -16,7 +16,7 @@ public class CustomBlocksConfig extends ModConfigLoader{
public static CustomBlocksConfig getInstance() { public static CustomBlocksConfig getInstance() {
if (instance == null) { if (instance == null) {
instance = new CustomBlocksConfig(McMMO.p); instance = new CustomBlocksConfig(mcMMO.p);
} }
return instance; return instance;
@ -34,7 +34,7 @@ public class CustomBlocksConfig extends ModConfigLoader{
public List<ItemStack> customItems = new ArrayList<ItemStack>(); public List<ItemStack> customItems = new ArrayList<ItemStack>();
public List<CustomBlock> customBlocks = new ArrayList<CustomBlock>(); public List<CustomBlock> customBlocks = new ArrayList<CustomBlock>();
public CustomBlocksConfig(McMMO plugin) { public CustomBlocksConfig(mcMMO plugin) {
super(plugin, "blocks.yml"); super(plugin, "blocks.yml");
} }

View File

@ -8,7 +8,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection; 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.datatypes.mods.CustomTool;
import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.Repairable;
import com.gmail.nossr50.skills.repair.RepairableFactory; import com.gmail.nossr50.skills.repair.RepairableFactory;
@ -18,7 +18,7 @@ public class CustomToolsConfig extends ModConfigLoader {
public static CustomToolsConfig getInstance() { public static CustomToolsConfig getInstance() {
if (instance == null) { if (instance == null) {
instance = new CustomToolsConfig(McMMO.p); instance = new CustomToolsConfig(mcMMO.p);
} }
return instance; return instance;
@ -37,7 +37,7 @@ public class CustomToolsConfig extends ModConfigLoader {
public List<CustomTool> customToolList = new ArrayList<CustomTool>(); public List<CustomTool> customToolList = new ArrayList<CustomTool>();
public HashMap<Integer, CustomTool> customTools = new HashMap<Integer, CustomTool>(); public HashMap<Integer, CustomTool> customTools = new HashMap<Integer, CustomTool>();
private CustomToolsConfig(McMMO plugin) { private CustomToolsConfig(mcMMO plugin) {
super(plugin, "tools.yml"); super(plugin, "tools.yml");
} }

View File

@ -2,12 +2,12 @@ package com.gmail.nossr50.config.mods;
import java.io.File; import java.io.File;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.config.ConfigLoader;
public abstract class ModConfigLoader extends 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); super(plugin, "ModConfigs" + File.separator + fileName);
} }
} }

View File

@ -9,7 +9,7 @@ import org.getspout.spoutapi.gui.RenderPriority;
import org.getspout.spoutapi.gui.Widget; import org.getspout.spoutapi.gui.Widget;
import org.getspout.spoutapi.player.SpoutPlayer; 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.config.SpoutConfig;
import com.gmail.nossr50.spout.SpoutStuff; import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -19,7 +19,7 @@ public class HUDmmo {
private int center_x = 427 / 2; private int center_x = 427 / 2;
private String playerName; private String playerName;
private final McMMO plugin; private final mcMMO plugin;
private Widget xpbar = null; private Widget xpbar = null;
private GenericGradient xpfill = null; private GenericGradient xpfill = null;
@ -28,7 +28,7 @@ public class HUDmmo {
private GenericGradient xpicon_border = null; private GenericGradient xpicon_border = null;
private GenericTexture xpicon = null; private GenericTexture xpicon = null;
public HUDmmo(Player player, McMMO plugin) { public HUDmmo(Player player, mcMMO plugin) {
this.playerName = player.getName(); this.playerName = player.getName();
this.plugin = plugin; this.plugin = plugin;
initializeHUD(player); initializeHUD(player);

View File

@ -11,7 +11,7 @@ import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; 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.Config;
import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.config.SpoutConfig;
import com.gmail.nossr50.datatypes.mods.CustomTool; import com.gmail.nossr50.datatypes.mods.CustomTool;
@ -62,7 +62,7 @@ public class PlayerProfile {
private Player player; private Player player;
private String playerName; private String playerName;
private final static String location = McMMO.usersFile; private final static String location = mcMMO.usersFile;
public PlayerProfile(Player player, boolean addNew) { public PlayerProfile(Player player, boolean addNew) {
hud = SpoutConfig.getInstance().defaulthud; hud = SpoutConfig.getInstance().defaulthud;
@ -100,15 +100,15 @@ public class PlayerProfile {
public boolean loadMySQL() { public boolean loadMySQL() {
int id = 0; 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; this.userid = id;
if (id > 0) { if (id > 0) {
HashMap<Integer, ArrayList<String>> huds = McMMO.database.read("SELECT hudtype FROM "+Config.getInstance().getMySQLTablePrefix()+"huds WHERE user_id = " + id); HashMap<Integer, ArrayList<String>> huds = mcMMO.database.read("SELECT hudtype FROM "+Config.getInstance().getMySQLTablePrefix()+"huds WHERE user_id = " + id);
if(huds.get(1) == null) 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 { } else {
if(huds.get(1).get(0) != null) if(huds.get(1).get(0) != null)
{ {
@ -123,17 +123,17 @@ public class PlayerProfile {
hud = SpoutConfig.getInstance().defaulthud; hud = SpoutConfig.getInstance().defaulthud;
} }
} }
HashMap<Integer, ArrayList<String>> users = McMMO.database.read("SELECT lastlogin, party FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE id = " + id); HashMap<Integer, ArrayList<String>> users = mcMMO.database.read("SELECT lastlogin, party FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE id = " + id);
//lastlogin = Integer.parseInt(users.get(1).get(0)); //lastlogin = Integer.parseInt(users.get(1).get(0));
party = users.get(1).get(1); party = users.get(1).get(1);
HashMap<Integer, ArrayList<String>> cooldowns = McMMO.database.read("SELECT mining, woodcutting, unarmed, herbalism, excavation, swords, axes, blast_mining FROM "+Config.getInstance().getMySQLTablePrefix()+"cooldowns WHERE user_id = " + id); HashMap<Integer, ArrayList<String>> 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 * I'm still learning MySQL, this is a fix for adding a new table
* its not pretty but it works * its not pretty but it works
*/ */
if(cooldowns.get(1) == null) 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 else
{ {
@ -146,7 +146,7 @@ public class PlayerProfile {
skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(cooldowns.get(1).get(6))); skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(cooldowns.get(1).get(6)));
skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(cooldowns.get(1).get(7))); skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(cooldowns.get(1).get(7)));
} }
HashMap<Integer, ArrayList<String>> 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<Integer, ArrayList<String>> 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.TAMING, Integer.valueOf(stats.get(1).get(0)));
skills.put(SkillType.MINING, Integer.valueOf(stats.get(1).get(1))); skills.put(SkillType.MINING, Integer.valueOf(stats.get(1).get(1)));
skills.put(SkillType.REPAIR, Integer.valueOf(stats.get(1).get(2))); 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.AXES, Integer.valueOf(stats.get(1).get(9)));
skills.put(SkillType.ACROBATICS, Integer.valueOf(stats.get(1).get(10))); skills.put(SkillType.ACROBATICS, Integer.valueOf(stats.get(1).get(10)));
skills.put(SkillType.FISHING, Integer.valueOf(stats.get(1).get(11))); skills.put(SkillType.FISHING, Integer.valueOf(stats.get(1).get(11)));
HashMap<Integer, ArrayList<String>> 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<Integer, ArrayList<String>> 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.TAMING, Integer.valueOf(experience.get(1).get(0)));
skillsXp.put(SkillType.MINING, Integer.valueOf(experience.get(1).get(1))); skillsXp.put(SkillType.MINING, Integer.valueOf(experience.get(1).get(1)));
skillsXp.put(SkillType.REPAIR, Integer.valueOf(experience.get(1).get(2))); skillsXp.put(SkillType.REPAIR, Integer.valueOf(experience.get(1).get(2)));
@ -182,11 +182,11 @@ public class PlayerProfile {
public void addMySQLPlayer() { public void addMySQLPlayer() {
int id = 0; int id = 0;
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")"); 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 + "'"); 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()+"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()+"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()+"experience (user_id) VALUES ("+id+")");
this.userid = id; this.userid = id;
} }
@ -289,7 +289,7 @@ public class PlayerProfile {
} }
in.close(); in.close();
} catch (Exception e) { } 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; return false;
} }
@ -299,10 +299,10 @@ public class PlayerProfile {
// if we are using mysql save to database // if we are using mysql save to database
if (Config.getInstance().getUseMySQL()) { 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()+"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 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()+"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()+"cooldowns SET "
+" mining = " + skillsDATS.get(AbilityType.SUPER_BREAKER) +" mining = " + skillsDATS.get(AbilityType.SUPER_BREAKER)
+", woodcutting = " + skillsDATS.get(AbilityType.TREE_FELLER) +", woodcutting = " + skillsDATS.get(AbilityType.TREE_FELLER)
+", unarmed = " + skillsDATS.get(AbilityType.BERSERK) +", unarmed = " + skillsDATS.get(AbilityType.BERSERK)
@ -312,7 +312,7 @@ public class PlayerProfile {
+", axes = " + skillsDATS.get(AbilityType.SKULL_SPLIITER) +", axes = " + skillsDATS.get(AbilityType.SKULL_SPLIITER)
+", blast_mining = " + skillsDATS.get(AbilityType.BLAST_MINING) +", blast_mining = " + skillsDATS.get(AbilityType.BLAST_MINING)
+" WHERE user_id = "+this.userid); +" 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) +" taming = "+skills.get(SkillType.TAMING)
+", mining = "+skills.get(SkillType.MINING) +", mining = "+skills.get(SkillType.MINING)
+", repair = "+skills.get(SkillType.REPAIR) +", repair = "+skills.get(SkillType.REPAIR)
@ -326,7 +326,7 @@ public class PlayerProfile {
+", acrobatics = "+skills.get(SkillType.ACROBATICS) +", acrobatics = "+skills.get(SkillType.ACROBATICS)
+", fishing = "+skills.get(SkillType.FISHING) +", fishing = "+skills.get(SkillType.FISHING)
+" WHERE user_id = "+this.userid); +" 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) +" taming = "+skillsXp.get(SkillType.TAMING)
+", mining = "+skillsXp.get(SkillType.MINING) +", mining = "+skillsXp.get(SkillType.MINING)
+", repair = "+skillsXp.get(SkillType.REPAIR) +", repair = "+skillsXp.get(SkillType.REPAIR)
@ -409,7 +409,7 @@ public class PlayerProfile {
out.close(); out.close();
} }
catch (Exception e) { 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.newLine();
out.close(); out.close();
} catch (Exception e) { } 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; 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); skillsXp.put(x, skillsXp.get(x) + newValue);
} }
} }
else { 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); skillsXp.put(skillType, skillsXp.get(skillType) + newValue);
lastgained = skillType; lastgained = skillType;
} }
@ -1046,7 +1046,7 @@ public class PlayerProfile {
xp = xp * 2; 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); skillsXp.put(skillType, skillsXp.get(skillType) + xp);
lastgained = skillType; lastgained = skillType;
} }

View File

@ -5,7 +5,7 @@ import org.bukkit.entity.Player;
import org.getspout.spoutapi.gui.GenericLabel; import org.getspout.spoutapi.gui.GenericLabel;
import org.getspout.spoutapi.gui.GenericPopup; 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.PlayerProfile;
import com.gmail.nossr50.datatypes.buttons.ButtonEscape; import com.gmail.nossr50.datatypes.buttons.ButtonEscape;
import com.gmail.nossr50.datatypes.buttons.ButtonHUDStyle; 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_x = 427 / 2;
private int center_y = 240 / 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 //240, 427 are the bottom right
mcMMO_label.setText(ChatColor.GOLD + "~mcMMO Menu~"); //TODO: Needs more locale mcMMO_label.setText(ChatColor.GOLD + "~mcMMO Menu~"); //TODO: Needs more locale

View File

@ -19,7 +19,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import org.getspout.spoutapi.sound.SoundEffect; 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.Config;
import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
@ -42,9 +42,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class BlockListener implements Listener { 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; this.plugin = plugin;
} }
@ -59,15 +59,15 @@ public class BlockListener implements Listener {
BlockFace direction = event.getDirection(); BlockFace direction = event.getDirection();
for (Block b : blocks) { for (Block b : blocks) {
if (McMMO.placeStore.isTrue(b)) { if (mcMMO.placeStore.isTrue(b)) {
b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true)); b.getRelative(direction).setMetadata("pistonTrack", new FixedMetadataValue(plugin, true));
McMMO.placeStore.setFalse(b); mcMMO.placeStore.setFalse(b);
} }
} }
for (Block b : blocks) { for (Block b : blocks) {
if (b.getRelative(direction).hasMetadata("pistonTrack")) { if (b.getRelative(direction).hasMetadata("pistonTrack")) {
McMMO.placeStore.setTrue(b.getRelative(direction)); mcMMO.placeStore.setTrue(b.getRelative(direction));
b.getRelative(direction).removeMetadata("pistonTrack", plugin); b.getRelative(direction).removeMetadata("pistonTrack", plugin);
} }
} }
@ -87,7 +87,7 @@ public class BlockListener implements Listener {
Block fallenBlock = event.getBlock().getRelative(BlockFace.UP); Block fallenBlock = event.getBlock().getRelative(BlockFace.UP);
if (fallenBlock.getType() == type) { 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) { public void onBlockPistonRetract(BlockPistonRetractEvent event) {
Block block = event.getRetractLocation().getBlock(); Block block = event.getRetractLocation().getBlock();
if (event.isSticky() && McMMO.placeStore.isTrue(block)) { if (event.isSticky() && mcMMO.placeStore.isTrue(block)) {
McMMO.placeStore.setFalse(block); mcMMO.placeStore.setFalse(block);
McMMO.placeStore.setTrue(event.getBlock().getRelative(event.getDirection())); mcMMO.placeStore.setTrue(event.getBlock().getRelative(event.getDirection()));
} }
} }
@ -129,7 +129,7 @@ public class BlockListener implements Listener {
} }
else { else {
Block newLocation = block.getRelative(0, y + 1, 0); Block newLocation = block.getRelative(0, y + 1, 0);
McMMO.placeStore.setTrue(newLocation); mcMMO.placeStore.setTrue(newLocation);
break; 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 */ /* Check if the blocks placed should be monitored so they do not give out XP in the future */
if (BlockChecks.shouldBeWatched(block)) { 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. 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 */ /* 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 (configInstance.getExcavationRequiresTool()) {
if (ItemChecks.isShovel(inHand)) { if (ItemChecks.isShovel(inHand)) {
Excavation.excavationProcCheck(block, player); Excavation.excavationProcCheck(block, player);
@ -231,8 +231,8 @@ public class BlockListener implements Listener {
} }
//Remove metadata when broken //Remove metadata when broken
if (McMMO.placeStore.isTrue(block) && BlockChecks.shouldBeWatched(block)) { if (mcMMO.placeStore.isTrue(block) && BlockChecks.shouldBeWatched(block)) {
McMMO.placeStore.setFalse(block); mcMMO.placeStore.setFalse(block);
} }
//Remove metadata from fallen sand/gravel //Remove metadata from fallen sand/gravel
@ -243,11 +243,11 @@ public class BlockListener implements Listener {
Block relative = block.getRelative(0, y, 0); Block relative = block.getRelative(0, y, 0);
Material relativeType = relative.getType(); Material relativeType = relative.getType();
if ((relativeType == Material.SAND || relativeType == Material.GRAVEL) && McMMO.placeStore.isTrue(relative)) { if ((relativeType == Material.SAND || relativeType == Material.GRAVEL) && mcMMO.placeStore.isTrue(relative)) {
McMMO.placeStore.setFalse(relative); mcMMO.placeStore.setFalse(relative);
} }
else if (!BlockChecks.shouldBeWatched(relative) && McMMO.placeStore.isTrue(relative)){ else if (!BlockChecks.shouldBeWatched(relative) && mcMMO.placeStore.isTrue(relative)){
McMMO.placeStore.setFalse(relative); mcMMO.placeStore.setFalse(relative);
} }
else { else {
break; break;
@ -301,7 +301,7 @@ public class BlockListener implements Listener {
} }
/* TREE FELLER SOUNDS */ /* 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()); SpoutSounds.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
} }
@ -346,7 +346,7 @@ public class BlockListener implements Listener {
event.setInstaBreak(true); event.setInstaBreak(true);
} }
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
} }
} }

View File

@ -24,7 +24,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.metadata.FixedMetadataValue; 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.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -43,9 +43,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class EntityListener implements Listener { 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; this.plugin = plugin;
} }

View File

@ -21,7 +21,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack; 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.commands.general.XprateCommand;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.AbilityType;
@ -45,9 +45,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PlayerListener implements Listener { 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; this.plugin = plugin;
} }
@ -139,7 +139,7 @@ public class PlayerListener implements Listener {
/* GARBAGE COLLECTION */ /* GARBAGE COLLECTION */
//Remove Spout Stuff //Remove Spout Stuff
if (McMMO.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player)) { if (mcMMO.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player)) {
SpoutStuff.playerHUDs.remove(player); SpoutStuff.playerHUDs.remove(player);
} }
@ -226,8 +226,8 @@ public class PlayerListener implements Listener {
/* REPAIR CHECKS */ /* REPAIR CHECKS */
if (Permissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId()) { if (Permissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId()) {
if (McMMO.repairManager.isRepairable(inHand)) { if (mcMMO.repairManager.isRepairable(inHand)) {
McMMO.repairManager.handleRepair(player, inHand); mcMMO.repairManager.handleRepair(player, inHand);
event.setCancelled(true); event.setCancelled(true);
player.updateInventory(); player.updateInventory();
} }

View File

@ -10,7 +10,7 @@ import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
import org.getspout.spoutapi.gui.ScreenType; import org.getspout.spoutapi.gui.ScreenType;
import org.getspout.spoutapi.player.SpoutPlayer; 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.config.SpoutConfig;
import com.gmail.nossr50.datatypes.HUDType; import com.gmail.nossr50.datatypes.HUDType;
import com.gmail.nossr50.datatypes.HUDmmo; import com.gmail.nossr50.datatypes.HUDmmo;
@ -23,9 +23,9 @@ import com.gmail.nossr50.spout.SpoutStuff;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class SpoutListener implements Listener { public class SpoutListener implements Listener {
private final McMMO plugin; private final mcMMO plugin;
public SpoutListener(McMMO plugin) { public SpoutListener(mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -10,7 +10,7 @@ import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldSaveEvent; import org.bukkit.event.world.WorldSaveEvent;
import org.bukkit.event.world.WorldUnloadEvent; import org.bukkit.event.world.WorldUnloadEvent;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public class WorldListener implements Listener { public class WorldListener implements Listener {
@EventHandler @EventHandler
@ -23,21 +23,21 @@ public class WorldListener implements Listener {
@EventHandler @EventHandler
public void onWorldUnload(WorldUnloadEvent event) { public void onWorldUnload(WorldUnloadEvent event) {
McMMO.placeStore.unloadWorld(event.getWorld()); mcMMO.placeStore.unloadWorld(event.getWorld());
} }
@EventHandler @EventHandler
public void onWorldSave(WorldSaveEvent event) { public void onWorldSave(WorldSaveEvent event) {
McMMO.placeStore.saveWorld(event.getWorld()); mcMMO.placeStore.saveWorld(event.getWorld());
} }
@EventHandler @EventHandler
public void onChunkLoad(ChunkLoadEvent event) { 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 @EventHandler
public void onChunkUnload(ChunkUnloadEvent event) { 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());
} }
} }

View File

@ -78,7 +78,7 @@ import com.gmail.nossr50.util.Users;
import com.gmail.nossr50.util.blockmeta.ChunkletManager; import com.gmail.nossr50.util.blockmeta.ChunkletManager;
import com.gmail.nossr50.util.blockmeta.ChunkletManagerFactory; 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 PlayerListener playerListener = new PlayerListener(this);
private final BlockListener blockListener = new BlockListener(this); private final BlockListener blockListener = new BlockListener(this);
@ -91,7 +91,7 @@ public class McMMO extends JavaPlugin {
public static File versionFile; public static File versionFile;
public static Database database; public static Database database;
public static McMMO p; public static mcMMO p;
public static ChunkletManager placeStore; public static ChunkletManager placeStore;
public static RepairManager repairManager; public static RepairManager repairManager;

View File

@ -16,7 +16,7 @@ import java.util.Map;
import org.bukkit.entity.Player; 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.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
@ -31,11 +31,11 @@ public class Party {
HashMap<String, Boolean> partyLocks = new HashMap<String, Boolean>(); HashMap<String, Boolean> partyLocks = new HashMap<String, Boolean>();
HashMap<String, String> partyPasswords = new HashMap<String, String>(); HashMap<String, String> partyPasswords = new HashMap<String, String>();
private static McMMO plugin; private static mcMMO plugin;
private static volatile Party instance; private static volatile Party instance;
private Party() { private Party() {
plugin = McMMO.p; plugin = mcMMO.p;
pluginPath = plugin.getDataFolder().getPath(); pluginPath = plugin.getDataFolder().getPath();
partyPlayersFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPlayers"; partyPlayersFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyPlayers";
partyLocksFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyLocks"; partyLocksFile = pluginPath + File.separator + "FlatFileStuff" + File.separator + "partyLocks";
@ -168,7 +168,7 @@ public class Party {
* @return the list of parties. * @return the list of parties.
*/ */
public ArrayList<String> getParties() { public ArrayList<String> getParties() {
String location = McMMO.usersFile; String location = mcMMO.usersFile;
ArrayList<String> parties = new ArrayList<String>(); ArrayList<String> parties = new ArrayList<String>();
try { try {

View File

@ -9,7 +9,7 @@ import java.util.Map.Entry;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; 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.locale.LocaleLoader;
import com.gmail.nossr50.util.Combat; import com.gmail.nossr50.util.Combat;
@ -71,7 +71,7 @@ public class BleedTimer implements Runnable {
private void updateBleedList() { private void updateBleedList() {
if (lock) { 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 { else {
bleedList.keySet().removeAll(bleedRemoveList); bleedList.keySet().removeAll(bleedRemoveList);

View File

@ -3,21 +3,21 @@ package com.gmail.nossr50.runnables;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileReader; import java.io.FileReader;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
public class SQLConversionTask implements Runnable { public class SQLConversionTask implements Runnable {
private final McMMO plugin; private final mcMMO plugin;
private String tablePrefix = Config.getInstance().getMySQLTablePrefix(); private String tablePrefix = Config.getInstance().getMySQLTablePrefix();
public SQLConversionTask(McMMO plugin) { public SQLConversionTask(mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }
@Override @Override
public void run() { public void run() {
String location = McMMO.usersFile; String location = mcMMO.usersFile;
try { try {
FileReader file = new FileReader(location); FileReader file = new FileReader(location);
@ -164,7 +164,7 @@ public class SQLConversionTask implements Runnable {
} }
//Check to see if the user is in the DB //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 + tablePrefix
+ "users WHERE user = '" + playerName + "'"); + "users WHERE user = '" + playerName + "'");
@ -172,11 +172,11 @@ public class SQLConversionTask implements Runnable {
theCount++; theCount++;
//Update the skill values //Update the skill values
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "users SET lastlogin = " + 0 + "users SET lastlogin = " + 0
+ " WHERE id = " + id); + " WHERE id = " + id);
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "skills SET " + "skills SET "
+ " taming = taming+" + Misc.getInt(taming) + " taming = taming+" + Misc.getInt(taming)
@ -192,7 +192,7 @@ public class SQLConversionTask implements Runnable {
+ ", acrobatics = acrobatics+" + Misc.getInt(acrobatics) + ", acrobatics = acrobatics+" + Misc.getInt(acrobatics)
+ ", fishing = fishing+" + Misc.getInt(fishing) + ", fishing = fishing+" + Misc.getInt(fishing)
+ " WHERE user_id = " + id); + " WHERE user_id = " + id);
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "experience SET " + "experience SET "
+ " taming = " + Misc.getInt(tamingXP) + " taming = " + Misc.getInt(tamingXP)
@ -213,32 +213,32 @@ public class SQLConversionTask implements Runnable {
theCount++; theCount++;
//Create the user in the DB //Create the user in the DB
McMMO.database.write("INSERT INTO " mcMMO.database.write("INSERT INTO "
+ tablePrefix + tablePrefix
+ "users (user, lastlogin) VALUES ('" + "users (user, lastlogin) VALUES ('"
+ playerName + "'," + playerName + "',"
+ System.currentTimeMillis() / 1000 + ")"); + System.currentTimeMillis() / 1000 + ")");
id = McMMO.database.getInt("SELECT id FROM " id = mcMMO.database.getInt("SELECT id FROM "
+ tablePrefix + tablePrefix
+ "users WHERE user = '" + "users WHERE user = '"
+ playerName + "'"); + playerName + "'");
McMMO.database.write("INSERT INTO " mcMMO.database.write("INSERT INTO "
+ tablePrefix + tablePrefix
+ "skills (user_id) VALUES (" + id + ")"); + "skills (user_id) VALUES (" + id + ")");
McMMO.database.write("INSERT INTO " mcMMO.database.write("INSERT INTO "
+ tablePrefix + tablePrefix
+ "experience (user_id) VALUES (" + id + "experience (user_id) VALUES (" + id
+ ")"); + ")");
//Update the skill values //Update the skill values
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "users SET lastlogin = " + 0 + "users SET lastlogin = " + 0
+ " WHERE id = " + id); + " WHERE id = " + id);
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "users SET party = '" + party + "users SET party = '" + party
+ "' WHERE id = " + id); + "' WHERE id = " + id);
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "skills SET " + "skills SET "
+ " taming = taming+" + Misc.getInt(taming) + " taming = taming+" + Misc.getInt(taming)
@ -254,7 +254,7 @@ public class SQLConversionTask implements Runnable {
+ ", acrobatics = acrobatics+" + Misc.getInt(acrobatics) + ", acrobatics = acrobatics+" + Misc.getInt(acrobatics)
+ ", fishing = fishing+" + Misc.getInt(fishing) + ", fishing = fishing+" + Misc.getInt(fishing)
+ " WHERE user_id = " + id); + " WHERE user_id = " + id);
McMMO.database.write("UPDATE " mcMMO.database.write("UPDATE "
+ tablePrefix + tablePrefix
+ "experience SET " + "experience SET "
+ " taming = " + Misc.getInt(tamingXP) + " taming = " + Misc.getInt(tamingXP)

View File

@ -2,15 +2,15 @@ package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player; 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.datatypes.PlayerProfile;
import com.gmail.nossr50.util.Database; import com.gmail.nossr50.util.Database;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class SQLReconnect implements Runnable { public class SQLReconnect implements Runnable {
private final McMMO plugin; private final mcMMO plugin;
public SQLReconnect(McMMO plugin) { public SQLReconnect(mcMMO plugin) {
this.plugin = plugin; this.plugin = plugin;
} }

View File

@ -2,12 +2,12 @@ package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public class SaveTimer implements Runnable { 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; this.plugin = plugin;
} }

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player; 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.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -10,9 +10,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class SkillMonitor implements Runnable { 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; this.plugin = plugin;
} }

View File

@ -3,28 +3,28 @@ package com.gmail.nossr50.runnables;
import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.FileManager; 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.config.SpoutConfig;
import com.gmail.nossr50.spout.SpoutStuff; import com.gmail.nossr50.spout.SpoutStuff;
public class SpoutStart implements Runnable{ 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; this.plugin = plugin;
} }
@Override @Override
public void run() { public void run() {
if (plugin.getServer().getPluginManager().getPlugin("Spout") != null) { if (plugin.getServer().getPluginManager().getPlugin("Spout") != null) {
McMMO.spoutEnabled = true; mcMMO.spoutEnabled = true;
} }
else { else {
McMMO.spoutEnabled = false; mcMMO.spoutEnabled = false;
} }
//Spout Stuff //Spout Stuff
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutConfig.getInstance(); SpoutConfig.getInstance();
SpoutStuff.setupSpoutConfigs(); SpoutStuff.setupSpoutConfigs();
SpoutStuff.registerCustomEvent(); SpoutStuff.registerCustomEvent();

View File

@ -18,7 +18,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue; 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.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -202,7 +202,7 @@ public class Taming {
* @param type Type of animal to summon * @param type Type of animal to summon
* @param player Player summoning the animal * @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(); ItemStack item = player.getItemInHand();
Material summonItem = null; Material summonItem = null;
int summonAmount = 0; int summonAmount = 0;

View File

@ -16,7 +16,7 @@ import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.player.PlayerInteractEvent; 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.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -52,7 +52,7 @@ public class BlastMining {
blocksDropped.add(temp); blocksDropped.add(temp);
Mining.miningDrops(temp); Mining.miningDrops(temp);
if (!McMMO.placeStore.isTrue(temp)) { if (!mcMMO.placeStore.isTrue(temp)) {
for (int i = 1 ; i < extraDrops ; i++) { for (int i = 1 ; i < extraDrops ; i++) {
blocksDropped.add(temp); blocksDropped.add(temp);
Mining.miningDrops(temp); Mining.miningDrops(temp);
@ -159,7 +159,7 @@ public class BlastMining {
} }
for (Block block : xp) { for (Block block : xp) {
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
Mining.miningXP(player, block); Mining.miningXP(player, block);
} }
} }
@ -241,7 +241,7 @@ public class BlastMining {
* @param player Player detonating the TNT * @param player Player detonating the TNT
* @param plugin mcMMO plugin instance * @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); PlayerProfile PP = Users.getProfile(player);
if (PP.getSkillLevel(SkillType.MINING) < 125) if (PP.getSkillLevel(SkillType.MINING) < 125)

View File

@ -11,7 +11,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.sound.SoundEffect; 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.Config;
import com.gmail.nossr50.config.TreasuresConfig; import com.gmail.nossr50.config.TreasuresConfig;
import com.gmail.nossr50.config.mods.CustomBlocksConfig; import com.gmail.nossr50.config.mods.CustomBlocksConfig;
@ -118,15 +118,15 @@ public class Excavation {
public static void gigaDrillBreaker(Player player, Block block) { public static void gigaDrillBreaker(Player player, Block block) {
Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage()); Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage());
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); 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);
Excavation.excavationProcCheck(block, player); Excavation.excavationProcCheck(block, player);
} }
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
} }
} }

View File

@ -11,7 +11,7 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; 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.Config;
import com.gmail.nossr50.config.mods.CustomBlocksConfig; import com.gmail.nossr50.config.mods.CustomBlocksConfig;
import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.AbilityType;
@ -73,7 +73,7 @@ public class Herbalism {
* @param event The event to use for Green Thumb * @param event The event to use for Green Thumb
* @param plugin mcMMO plugin instance * @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 PlayerProfile PP = Users.getProfile(player);
final int MAX_BONUS_LEVEL = 1000; final int MAX_BONUS_LEVEL = 1000;
@ -94,7 +94,7 @@ public class Herbalism {
switch (type) { switch (type) {
case BROWN_MUSHROOM: case BROWN_MUSHROOM:
case RED_MUSHROOM: case RED_MUSHROOM:
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
mat = Material.getMaterial(id); mat = Material.getMaterial(id);
xp = Config.getInstance().getHerbalismXPMushrooms(); xp = Config.getInstance().getHerbalismXPMushrooms();
} }
@ -105,7 +105,7 @@ public class Herbalism {
Block b = block.getRelative(0, y, 0); Block b = block.getRelative(0, y, 0);
if (b.getType().equals(Material.CACTUS)) { if (b.getType().equals(Material.CACTUS)) {
mat = Material.CACTUS; mat = Material.CACTUS;
if (!McMMO.placeStore.isTrue(b)) { if (!mcMMO.placeStore.isTrue(b)) {
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
catciDrops++; catciDrops++;
} }
@ -127,7 +127,7 @@ public class Herbalism {
break; break;
case MELON_BLOCK: case MELON_BLOCK:
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
mat = Material.MELON; mat = Material.MELON;
xp = Config.getInstance().getHerbalismXPMelon(); xp = Config.getInstance().getHerbalismXPMelon();
} }
@ -142,7 +142,7 @@ public class Herbalism {
case PUMPKIN: case PUMPKIN:
case JACK_O_LANTERN: case JACK_O_LANTERN:
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
mat = Material.getMaterial(id); mat = Material.getMaterial(id);
xp = Config.getInstance().getHerbalismXPPumpkin(); xp = Config.getInstance().getHerbalismXPPumpkin();
} }
@ -150,7 +150,7 @@ public class Herbalism {
case RED_ROSE: case RED_ROSE:
case YELLOW_FLOWER: case YELLOW_FLOWER:
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
mat = Material.getMaterial(id); mat = Material.getMaterial(id);
xp = Config.getInstance().getHerbalismXPFlowers(); xp = Config.getInstance().getHerbalismXPFlowers();
} }
@ -161,7 +161,7 @@ public class Herbalism {
Block b = block.getRelative(0, y, 0); Block b = block.getRelative(0, y, 0);
if (b.getType().equals(Material.SUGAR_CANE_BLOCK)) { if (b.getType().equals(Material.SUGAR_CANE_BLOCK)) {
mat = Material.SUGAR_CANE; mat = Material.SUGAR_CANE;
if (!McMMO.placeStore.isTrue(b)) { if (!mcMMO.placeStore.isTrue(b)) {
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
caneDrops++; caneDrops++;
} }
@ -172,14 +172,14 @@ public class Herbalism {
break; break;
case VINE: case VINE:
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
mat = type; mat = type;
xp = Config.getInstance().getHerbalismXPVines(); xp = Config.getInstance().getHerbalismXPVines();
} }
break; break;
case WATER_LILY: case WATER_LILY:
if (!McMMO.placeStore.isTrue(block)) { if (!mcMMO.placeStore.isTrue(block)) {
mat = type; mat = type;
xp = Config.getInstance().getHerbalismXPLilyPads(); xp = Config.getInstance().getHerbalismXPLilyPads();
} }
@ -299,7 +299,7 @@ public class Herbalism {
* @param event The event triggering the ability * @param event The event triggering the ability
* @param plugin mcMMO plugin instance * @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; final int MAX_BONUS_LEVEL = 1500;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -11,7 +11,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.sound.SoundEffect; 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.Config;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -285,7 +285,7 @@ public class Mining {
* @param block The block being broken * @param block The block being broken
*/ */
public static void miningBlockCheck(Player player, Block block) { public static void miningBlockCheck(Player player, Block block) {
if (McMMO.placeStore.isTrue(block)) { if (mcMMO.placeStore.isTrue(block)) {
return; return;
} }
@ -322,16 +322,16 @@ public class Mining {
return; return;
} }
if (McMMO.placeStore.isTrue(block)) { if (mcMMO.placeStore.isTrue(block)) {
return; return;
} }
McMMO.p.getServer().getPluginManager().callEvent(armswing); mcMMO.p.getServer().getPluginManager().callEvent(armswing);
Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss); Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss);
miningBlockCheck(player, block); miningBlockCheck(player, block);
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
} }
} }
@ -367,16 +367,16 @@ public class Mining {
case NETHERRACK: case NETHERRACK:
case SANDSTONE: case SANDSTONE:
case STONE: case STONE:
if (McMMO.placeStore.isTrue(block)) { if (mcMMO.placeStore.isTrue(block)) {
return; return;
} }
McMMO.p.getServer().getPluginManager().callEvent(armswing); mcMMO.p.getServer().getPluginManager().callEvent(armswing);
Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss); Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss);
miningBlockCheck(player, block); miningBlockCheck(player, block);
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
} }
} }

View File

@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Tree; import org.bukkit.material.Tree;
import org.getspout.spoutapi.sound.SoundEffect; 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.Config;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -107,7 +107,7 @@ public class WoodCutting {
CustomBlock block = ModChecks.getCustomBlock(x); CustomBlock block = ModChecks.getCustomBlock(x);
item = block.getItemDrop(); item = block.getItemDrop();
if (!McMMO.placeStore.isTrue(x)) { if (!mcMMO.placeStore.isTrue(x)) {
WoodCutting.woodCuttingProcCheck(player, x); WoodCutting.woodCuttingProcCheck(player, x);
xp = block.getXpGain(); xp = block.getXpGain();
} }
@ -156,7 +156,7 @@ public class WoodCutting {
break; break;
} }
if (!McMMO.placeStore.isTrue(x)) { if (!mcMMO.placeStore.isTrue(x)) {
WoodCutting.woodCuttingProcCheck(player, x); WoodCutting.woodCuttingProcCheck(player, x);
switch (species) { switch (species) {
@ -232,7 +232,7 @@ public class WoodCutting {
Block zNegative = currentBlock.getRelative(0, 0, -1); Block zNegative = currentBlock.getRelative(0, 0, -1);
Block yPositive = currentBlock.getRelative(0, 1, 0); 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)) { if (!isTooAggressive(currentBlock, xPositive) && BlockChecks.treeFellerCompatible(xPositive) && !toBeFelled.contains(xPositive)) {
processTreeFelling(xPositive, toBeFelled); processTreeFelling(xPositive, toBeFelled);
} }
@ -251,7 +251,7 @@ public class WoodCutting {
} }
if (BlockChecks.treeFellerCompatible(yPositive)) { if (BlockChecks.treeFellerCompatible(yPositive)) {
if(!McMMO.placeStore.isTrue(currentBlock) && !toBeFelled.contains(yPositive)) { if(!mcMMO.placeStore.isTrue(currentBlock) && !toBeFelled.contains(yPositive)) {
processTreeFelling(yPositive, toBeFelled); processTreeFelling(yPositive, toBeFelled);
} }
} }
@ -351,7 +351,7 @@ public class WoodCutting {
int xp = 0; int xp = 0;
TreeSpecies species = TreeSpecies.getByData(block.getData()); TreeSpecies species = TreeSpecies.getByData(block.getData());
if (McMMO.placeStore.isTrue(block)) { if (mcMMO.placeStore.isTrue(block)) {
return; return;
} }
@ -393,13 +393,13 @@ public class WoodCutting {
*/ */
public static void leafBlower(Player player, Block block) { public static void leafBlower(Player player, Block block) {
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
McMMO.p.getServer().getPluginManager().callEvent(armswing); mcMMO.p.getServer().getPluginManager().callEvent(armswing);
if (Config.getInstance().getWoodcuttingRequiresTool()) { if (Config.getInstance().getWoodcuttingRequiresTool()) {
Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage()); Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage());
} }
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
} }
} }

View File

@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer; 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.Config;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -45,8 +45,8 @@ public class Repair {
Skills.xpProcessing(player, PP, SkillType.REPAIR, dif * 10); Skills.xpProcessing(player, PP, SkillType.REPAIR, dif * 10);
//CLANG CLANG //CLANG CLANG
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutSounds.playRepairNoise(player, McMMO.p); SpoutSounds.playRepairNoise(player, mcMMO.p);
} }
} }
@ -241,7 +241,7 @@ public class Repair {
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);
if (!PP.getPlacedAnvil()) { if (!PP.getPlacedAnvil()) {
if (McMMO.spoutEnabled) { if (mcMMO.spoutEnabled) {
SpoutPlayer sPlayer = SpoutManager.getPlayer(player); SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if (sPlayer.isSpoutCraftEnabled()) { if (sPlayer.isSpoutCraftEnabled()) {

View File

@ -205,6 +205,19 @@ public class SimpleRepairManager implements RepairManager {
ItemStack[] contents = inventory.getContents(); ItemStack[] contents = inventory.getContents();
for (int i = 0; i < contents.length; i++) { for (int i = 0; i < contents.length; i++) {
ItemStack item = contents[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.getTypeId() == itemId) {
if (item.getData().getData() == metadata) { if (item.getData().getData() == metadata) {
location = i; location = i;

View File

@ -7,7 +7,7 @@ import org.getspout.spoutapi.player.SpoutPlayer;
import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundEffect;
import org.getspout.spoutapi.sound.SoundManager; import org.getspout.spoutapi.sound.SoundManager;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public class SpoutSounds { public class SpoutSounds {
@ -30,7 +30,7 @@ public class SpoutSounds {
* *
* @param player The player who repaired an item * @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(); SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player); SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
@ -43,7 +43,7 @@ public class SpoutSounds {
* *
* @param player The player who leveled up * @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(); SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player); SpoutPlayer sPlayer = SpoutManager.getPlayer(player);

View File

@ -19,7 +19,7 @@ import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.keyboard.Keyboard; import org.getspout.spoutapi.keyboard.Keyboard;
import org.getspout.spoutapi.player.SpoutPlayer; 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.config.SpoutConfig;
import com.gmail.nossr50.datatypes.HUDmmo; import com.gmail.nossr50.datatypes.HUDmmo;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
@ -30,9 +30,9 @@ import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class SpoutStuff { 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 hudDirectory = spoutDirectory + "HUD" + File.separator;
public final static String hudStandardDirectory = hudDirectory + "Standard" + File.separator; public final static String hudStandardDirectory = hudDirectory + "Standard" + File.separator;
public final static String hudRetroDirectory = hudDirectory + "Retro" + File.separator; public final static String hudRetroDirectory = hudDirectory + "Retro" + File.separator;
@ -55,7 +55,7 @@ public class SpoutStuff {
try { try {
File currentFile = new File(theFilePath + theFileName); File currentFile = new File(theFilePath + theFileName);
JarFile jar = new JarFile(McMMO.mcmmo); JarFile jar = new JarFile(mcMMO.mcmmo);
JarEntry entry = jar.getJarEntry("resources/" + theFileName); JarEntry entry = jar.getJarEntry("resources/" + theFileName);
InputStream is = jar.getInputStream(entry); InputStream is = jar.getInputStream(entry);

View File

@ -17,7 +17,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerAnimationEvent; import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.inventory.ItemStack; 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.Config;
import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
@ -315,7 +315,7 @@ public class Combat {
private static void dealDamage(LivingEntity target, int dmg, DamageCause cause) { private static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
if (configInstance.getEventCallbackEnabled()) { if (configInstance.getEventCallbackEnabled()) {
EntityDamageEvent ede = new FakeEntityDamageEvent(target, cause, dmg); EntityDamageEvent ede = new FakeEntityDamageEvent(target, cause, dmg);
McMMO.p.getServer().getPluginManager().callEvent(ede); mcMMO.p.getServer().getPluginManager().callEvent(ede);
if (ede.isCancelled()) { if (ede.isCancelled()) {
return; return;
@ -338,7 +338,7 @@ public class Combat {
private static void dealDamage(LivingEntity target, int dmg, Player attacker) { private static void dealDamage(LivingEntity target, int dmg, Player attacker) {
if (configInstance.getEventCallbackEnabled()) { if (configInstance.getEventCallbackEnabled()) {
EntityDamageEvent ede = new FakeEntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg); 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()) { if (ede.isCancelled()) {
return; return;
@ -383,7 +383,7 @@ public class Combat {
} }
PlayerAnimationEvent armswing = new PlayerAnimationEvent(attacker); PlayerAnimationEvent armswing = new PlayerAnimationEvent(attacker);
McMMO.p.getServer().getPluginManager().callEvent(armswing); mcMMO.p.getServer().getPluginManager().callEvent(armswing);
if (entity instanceof Player) { if (entity instanceof Player) {
Player defender = (Player) entity; Player defender = (Player) entity;
@ -541,7 +541,7 @@ public class Combat {
} }
if (baseXP != 0) { 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);
} }
} }
} }

View File

@ -9,7 +9,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Properties; import java.util.Properties;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.DatabaseUpdate; import com.gmail.nossr50.datatypes.DatabaseUpdate;
import com.gmail.nossr50.runnables.SQLReconnect; 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 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 String tablePrefix = Config.getInstance().getMySQLTablePrefix();
private static Connection conn = null; private static Connection conn = null;
private static McMMO plugin = null; private static mcMMO plugin = null;
private static long reconnectTimestamp = 0; private static long reconnectTimestamp = 0;
public Database(McMMO instance) { public Database(mcMMO instance) {
plugin = instance; plugin = instance;
connect(); //Connect to MySQL connect(); //Connect to MySQL

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.util;
import org.bukkit.inventory.ItemStack; 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.api.SpoutToolsAPI;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomArmorConfig;
@ -32,7 +32,7 @@ public class ItemChecks {
if (customToolsEnabled && CustomToolsConfig.getInstance().customSwordIDs.contains(is.getTypeId())) { if (customToolsEnabled && CustomToolsConfig.getInstance().customSwordIDs.contains(is.getTypeId())) {
return true; return true;
} }
else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutSwords.contains(is)) { else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutSwords.contains(is)) {
return true; return true;
} }
else { else {
@ -60,7 +60,7 @@ public class ItemChecks {
if (customToolsEnabled && CustomToolsConfig.getInstance().customHoeIDs.contains(is.getTypeId())) { if (customToolsEnabled && CustomToolsConfig.getInstance().customHoeIDs.contains(is.getTypeId())) {
return true; return true;
} }
else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutHoes.contains(is)) { else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutHoes.contains(is)) {
return true; return true;
} }
else { else {
@ -88,7 +88,7 @@ public class ItemChecks {
if (customToolsEnabled && CustomToolsConfig.getInstance().customShovelIDs.contains(is.getTypeId())) { if (customToolsEnabled && CustomToolsConfig.getInstance().customShovelIDs.contains(is.getTypeId())) {
return true; return true;
} }
else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutShovels.contains(is)) { else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutShovels.contains(is)) {
return true; return true;
} }
else { else {
@ -116,7 +116,7 @@ public class ItemChecks {
if (customToolsEnabled && CustomToolsConfig.getInstance().customAxeIDs.contains(is.getTypeId())) { if (customToolsEnabled && CustomToolsConfig.getInstance().customAxeIDs.contains(is.getTypeId())) {
return true; return true;
} }
else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutAxes.contains(is)) { else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutAxes.contains(is)) {
return true; return true;
} }
else { else {
@ -144,7 +144,7 @@ public class ItemChecks {
if (customToolsEnabled && CustomToolsConfig.getInstance().customPickaxeIDs.contains(is.getTypeId())) { if (customToolsEnabled && CustomToolsConfig.getInstance().customPickaxeIDs.contains(is.getTypeId())) {
return true; return true;
} }
else if (McMMO.spoutEnabled && SpoutToolsAPI.spoutPickaxes.contains(is)) { else if (mcMMO.spoutEnabled && SpoutToolsAPI.spoutPickaxes.contains(is)) {
return true; return true;
} }
else { else {

View File

@ -7,16 +7,16 @@ import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerStat; import com.gmail.nossr50.datatypes.PlayerStat;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.datatypes.Tree; import com.gmail.nossr50.datatypes.Tree;
public class Leaderboard { public class Leaderboard {
private static McMMO plugin = McMMO.p; private static mcMMO plugin = mcMMO.p;
private static String leaderboardsDirectory = McMMO.leaderboardDirectory; private static String leaderboardsDirectory = mcMMO.leaderboardDirectory;
private final static String location = McMMO.usersFile; private final static String location = mcMMO.usersFile;
/** /**
* Create the leaderboards. * Create the leaderboards.

View File

@ -11,7 +11,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.PluginManager; 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.config.Config;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
@ -110,10 +110,10 @@ public class Misc {
//Support for NoCheat //Support for NoCheat
if (shouldArmSwing) { if (shouldArmSwing) {
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); 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); FakeBlockDamageEvent damageEvent = new FakeBlockDamageEvent(player, block, player.getItemInHand(), true);
pluginManger.callEvent(damageEvent); 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. // 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); McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
McMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;

View File

@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer; 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.Config;
import com.gmail.nossr50.config.SpoutConfig; import com.gmail.nossr50.config.SpoutConfig;
import com.gmail.nossr50.datatypes.AbilityType; import com.gmail.nossr50.datatypes.AbilityType;
@ -194,7 +194,7 @@ public class Skills {
profile.skillUp(skillType, 1); profile.skillUp(skillType, 1);
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType); McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
McMMO.p.getServer().getPluginManager().callEvent(eventToFire); mcMMO.p.getServer().getPluginManager().callEvent(eventToFire);
} }
else { else {
profile.addLevels(skillType, 0); profile.addLevels(skillType, 0);
@ -209,7 +209,7 @@ public class Skills {
String capitalized = Misc.getCapitalized(skillType.toString()); String capitalized = Misc.getCapitalized(skillType.toString());
/* Spout Stuff */ /* Spout Stuff */
if (McMMO.spoutEnabled && player instanceof SpoutPlayer) { if (mcMMO.spoutEnabled && player instanceof SpoutPlayer) {
SpoutPlayer sPlayer = SpoutManager.getPlayer(player); SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
if (sPlayer.isSpoutCraftEnabled()) { if (sPlayer.isSpoutCraftEnabled()) {
@ -234,7 +234,7 @@ public class Skills {
} }
/* Always update XP Bar (Check if no levels were gained first to remove redundancy) */ /* 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; SpoutPlayer sPlayer = (SpoutPlayer) player;
if (sPlayer.isSpoutCraftEnabled()) { if (sPlayer.isSpoutCraftEnabled()) {
if (SpoutConfig.getInstance().getXPBarEnabled()) { if (SpoutConfig.getInstance().getXPBarEnabled()) {

View File

@ -8,7 +8,7 @@ import java.util.HashMap;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player; 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.datatypes.PlayerProfile;
public class Users { public class Users {
@ -18,10 +18,10 @@ public class Users {
* Load users. * Load users.
*/ */
public static void loadUsers() { public static void loadUsers() {
new File(McMMO.flatFileDirectory).mkdir(); new File(mcMMO.flatFileDirectory).mkdir();
new File(McMMO.leaderboardDirectory).mkdir(); new File(mcMMO.leaderboardDirectory).mkdir();
File theDir = new File(McMMO.usersFile); File theDir = new File(mcMMO.usersFile);
if (!theDir.exists()) { if (!theDir.exists()) {
try { try {
@ -79,7 +79,7 @@ public class Users {
* @param playerName The name of the player to remove * @param playerName The name of the player to remove
*/ */
public static void removeUserByName(String playerName) { 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 * @return the player's profile
*/ */
public static PlayerProfile getProfileByName(String playerName) { 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); PlayerProfile profile = players.get(player);
if (profile == null) { if (profile == null) {
@ -110,7 +110,7 @@ public class Users {
return newProfile; return newProfile;
} }
else { 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()) { for (StackTraceElement ste : new Throwable().getStackTrace()) {
System.out.println(ste); System.out.println(ste);

View File

@ -13,7 +13,7 @@ import org.bukkit.Bukkit;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
public class HashChunkletManager implements ChunkletManager { public class HashChunkletManager implements ChunkletManager {
private HashMap<String, ChunkletStore> store = new HashMap<String, ChunkletStore>(); private HashMap<String, ChunkletStore> store = new HashMap<String, ChunkletStore>();
@ -229,7 +229,7 @@ public class HashChunkletManager implements ChunkletManager {
} catch (IOException ex) { } catch (IOException ex) {
if (ex instanceof EOFException) { if (ex instanceof EOFException) {
// EOF should only happen on Chunklets that somehow have been corrupted. // 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(); return ChunkletStoreFactory.getChunkletStore();
} }
ex.printStackTrace(); ex.printStackTrace();

View File

@ -12,18 +12,18 @@ import java.util.zip.Deflater;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import com.gmail.nossr50.McMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
public class ZipLibrary { 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 BackupDir = new File(BackupDirectory);
private static File FlatFileDirectory = new File(McMMO.flatFileDirectory); private static File FlatFileDirectory = new File(mcMMO.flatFileDirectory);
private static File ModFileDirectory = new File(McMMO.modDirectory); private static File ModFileDirectory = new File(mcMMO.modDirectory);
private static File UsersFile = new File(McMMO.usersFile); private static File UsersFile = new File(mcMMO.usersFile);
private static File ConfigFile = new File(McMMO.mainDirectory + "config.yml"); private static File ConfigFile = new File(mcMMO.mainDirectory + "config.yml");
private static File TreasuresFile = new File(McMMO.mainDirectory + "treasures.yml"); private static File TreasuresFile = new File(mcMMO.mainDirectory + "treasures.yml");
private static File Leaderboards = new File(McMMO.leaderboardDirectory); private static File Leaderboards = new File(mcMMO.leaderboardDirectory);
public static void mcMMObackup() throws IOException { public static void mcMMObackup() throws IOException {
if (Config.getInstance().getUseMySQL()) { if (Config.getInstance().getUseMySQL()) {
@ -33,10 +33,10 @@ public class ZipLibrary {
try { try {
if (BackupDir.mkdir()) { if (BackupDir.mkdir()) {
McMMO.p.getLogger().info("Created Backup Directory."); mcMMO.p.getLogger().info("Created Backup Directory.");
} }
} catch (Exception e) { } catch (Exception e) {
McMMO.p.getLogger().severe(e.toString()); mcMMO.p.getLogger().severe(e.toString());
} }
//Generate the proper date for the backup filename //Generate the proper date for the backup filename