Because lowercase class names are evil.

This commit is contained in:
GJ 2012-06-06 14:49:07 -04:00
parent e9ea0e0389
commit e5d2ed4bb2
65 changed files with 305 additions and 305 deletions

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

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.api;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.util.Permissions;
@ -21,7 +21,7 @@ public class ChatAPI {
*/
public void sendPartyChat(String sender, String party, String message) {
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(sender, party, message);
mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
McMMO.p.getServer().getPluginManager().callEvent(chatEvent);
if (chatEvent.isCancelled()) {
return;
@ -29,9 +29,9 @@ public class ChatAPI {
String pPrefix = ChatColor.GREEN + "(" + ChatColor.WHITE + chatEvent.getSender() + ChatColor.GREEN + ") ";
mcMMO.p.getLogger().info("[P](" + chatEvent.getParty() + ")" + "<" + chatEvent.getSender() + "> " + chatEvent.getMessage());
McMMO.p.getLogger().info("[P](" + chatEvent.getParty() + ")" + "<" + chatEvent.getSender() + "> " + chatEvent.getMessage());
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
for (Player player : McMMO.p.getServer().getOnlinePlayers()) {
if (Users.getProfile(player).inParty()) {
if (Users.getProfile(player).getParty().equalsIgnoreCase(chatEvent.getParty())) {
player.sendMessage(pPrefix + chatEvent.getMessage());
@ -50,7 +50,7 @@ public class ChatAPI {
*/
public void sendAdminChat(String sender, String message) {
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(sender, message);
mcMMO.p.getServer().getPluginManager().callEvent(chatEvent);
McMMO.p.getServer().getPluginManager().callEvent(chatEvent);
if (chatEvent.isCancelled()) {
return;
@ -58,9 +58,9 @@ public class ChatAPI {
String aPrefix = ChatColor.AQUA + "{" + ChatColor.WHITE + chatEvent.getSender() + ChatColor.AQUA + "} ";
mcMMO.p.getLogger().info("[A]<" + chatEvent.getSender() + "> " + chatEvent.getMessage());
McMMO.p.getLogger().info("[A]<" + chatEvent.getSender() + "> " + chatEvent.getMessage());
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
for (Player player : McMMO.p.getServer().getOnlinePlayers()) {
if (Permissions.getInstance().adminChat(player) || player.isOp())
player.sendMessage(aPrefix + chatEvent.getMessage());
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Leaderboard;
@ -134,7 +134,7 @@ public class MctopCommand implements CommandExecutor {
private void sqlDisplay(int page, String query, CommandSender sender) {
String tablePrefix = Config.getInstance().getMySQLTablePrefix();
HashMap<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") {
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
@ -144,11 +144,11 @@ public class MctopCommand implements CommandExecutor {
}
for (int i = (page * 10) - 9; i <= (page * 10); i++) {
if (i > userslist.size() || mcMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) {
if (i > userslist.size() || McMMO.database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) {
break;
}
HashMap<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));
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.SpoutConfig;
@ -28,7 +28,7 @@ public class XplockCommand implements CommandExecutor {
return true;
}
if (!mcMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
if (!McMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
return true;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,12 +2,12 @@ package com.gmail.nossr50.config.mods;
import java.io.File;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.ConfigLoader;
public abstract class ModConfigLoader extends ConfigLoader{
public ModConfigLoader(mcMMO plugin, String fileName) {
public ModConfigLoader(McMMO plugin, String fileName) {
super(plugin, "ModConfigs" + File.separator + fileName);
}
}

View File

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

View File

@ -11,7 +11,7 @@ import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.SpoutConfig;
import com.gmail.nossr50.datatypes.mods.CustomTool;
@ -62,7 +62,7 @@ public class PlayerProfile {
private Player player;
private String playerName;
private final static String location = mcMMO.usersFile;
private final static String location = McMMO.usersFile;
public PlayerProfile(Player player, boolean addNew) {
hud = SpoutConfig.getInstance().defaulthud;
@ -100,15 +100,15 @@ public class PlayerProfile {
public boolean loadMySQL() {
int id = 0;
id = mcMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'");
id = McMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'");
this.userid = id;
if (id > 0) {
HashMap<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)
{
mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"huds (user_id) VALUES ("+id+")");
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"huds (user_id) VALUES ("+id+")");
} else {
if(huds.get(1).get(0) != null)
{
@ -123,17 +123,17 @@ public class PlayerProfile {
hud = SpoutConfig.getInstance().defaulthud;
}
}
HashMap<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));
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
* its not pretty but it works
*/
if(cooldowns.get(1) == null)
{
mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")");
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")");
}
else
{
@ -146,7 +146,7 @@ public class PlayerProfile {
skillsDATS.put(AbilityType.SKULL_SPLIITER, Integer.valueOf(cooldowns.get(1).get(6)));
skillsDATS.put(AbilityType.BLAST_MINING, Integer.valueOf(cooldowns.get(1).get(7)));
}
HashMap<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.MINING, Integer.valueOf(stats.get(1).get(1)));
skills.put(SkillType.REPAIR, Integer.valueOf(stats.get(1).get(2)));
@ -159,7 +159,7 @@ public class PlayerProfile {
skills.put(SkillType.AXES, Integer.valueOf(stats.get(1).get(9)));
skills.put(SkillType.ACROBATICS, Integer.valueOf(stats.get(1).get(10)));
skills.put(SkillType.FISHING, Integer.valueOf(stats.get(1).get(11)));
HashMap<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.MINING, Integer.valueOf(experience.get(1).get(1)));
skillsXp.put(SkillType.REPAIR, Integer.valueOf(experience.get(1).get(2)));
@ -182,11 +182,11 @@ public class PlayerProfile {
public void addMySQLPlayer() {
int id = 0;
mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")");
id = mcMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'");
mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")");
mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"skills (user_id) VALUES ("+id+")");
mcMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"experience (user_id) VALUES ("+id+")");
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")");
id = McMMO.database.getInt("SELECT id FROM "+Config.getInstance().getMySQLTablePrefix()+"users WHERE user = '" + playerName + "'");
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"cooldowns (user_id) VALUES ("+id+")");
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"skills (user_id) VALUES ("+id+")");
McMMO.database.write("INSERT INTO "+Config.getInstance().getMySQLTablePrefix()+"experience (user_id) VALUES ("+id+")");
this.userid = id;
}
@ -289,7 +289,7 @@ public class PlayerProfile {
}
in.close();
} catch (Exception e) {
mcMMO.p.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString());
McMMO.p.getLogger().severe("Exception while reading " + location + " (Are you sure you formatted it correctly?)" + e.toString());
}
return false;
}
@ -299,10 +299,10 @@ public class PlayerProfile {
// if we are using mysql save to database
if (Config.getInstance().getUseMySQL()) {
mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"huds SET hudtype = '"+hud.toString()+"' WHERE user_id = "+this.userid);
mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid);
mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET party = '"+this.party+"' WHERE id = " +this.userid);
mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"cooldowns SET "
McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"huds SET hudtype = '"+hud.toString()+"' WHERE user_id = "+this.userid);
McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET lastlogin = " + timestamp.intValue() + " WHERE id = " + this.userid);
McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"users SET party = '"+this.party+"' WHERE id = " +this.userid);
McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"cooldowns SET "
+" mining = " + skillsDATS.get(AbilityType.SUPER_BREAKER)
+", woodcutting = " + skillsDATS.get(AbilityType.TREE_FELLER)
+", unarmed = " + skillsDATS.get(AbilityType.BERSERK)
@ -312,7 +312,7 @@ public class PlayerProfile {
+", axes = " + skillsDATS.get(AbilityType.SKULL_SPLIITER)
+", blast_mining = " + skillsDATS.get(AbilityType.BLAST_MINING)
+" WHERE user_id = "+this.userid);
mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"skills SET "
McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"skills SET "
+" taming = "+skills.get(SkillType.TAMING)
+", mining = "+skills.get(SkillType.MINING)
+", repair = "+skills.get(SkillType.REPAIR)
@ -326,7 +326,7 @@ public class PlayerProfile {
+", acrobatics = "+skills.get(SkillType.ACROBATICS)
+", fishing = "+skills.get(SkillType.FISHING)
+" WHERE user_id = "+this.userid);
mcMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"experience SET "
McMMO.database.write("UPDATE "+Config.getInstance().getMySQLTablePrefix()+"experience SET "
+" taming = "+skillsXp.get(SkillType.TAMING)
+", mining = "+skillsXp.get(SkillType.MINING)
+", repair = "+skillsXp.get(SkillType.REPAIR)
@ -409,7 +409,7 @@ public class PlayerProfile {
out.close();
}
catch (Exception e) {
mcMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString());
McMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString());
}
}
}
@ -484,7 +484,7 @@ public class PlayerProfile {
out.newLine();
out.close();
} catch (Exception e) {
mcMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString());
McMMO.p.getLogger().severe("Exception while writing to " + location + " (Are you sure you formatted it correctly?)" + e.toString());
}
}
@ -976,12 +976,12 @@ public class PlayerProfile {
continue;
}
mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, x, newValue));
McMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, x, newValue));
skillsXp.put(x, skillsXp.get(x) + newValue);
}
}
else {
mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, newValue));
McMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, newValue));
skillsXp.put(skillType, skillsXp.get(skillType) + newValue);
lastgained = skillType;
}
@ -1046,7 +1046,7 @@ public class PlayerProfile {
xp = xp * 2;
}
mcMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, xp));
McMMO.p.getServer().getPluginManager().callEvent(new McMMOPlayerXpGainEvent(player, skillType, xp));
skillsXp.put(skillType, skillsXp.get(skillType) + xp);
lastgained = skillType;
}

View File

@ -5,7 +5,7 @@ import org.bukkit.entity.Player;
import org.getspout.spoutapi.gui.GenericLabel;
import org.getspout.spoutapi.gui.GenericPopup;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.buttons.ButtonEscape;
import com.gmail.nossr50.datatypes.buttons.ButtonHUDStyle;
@ -19,7 +19,7 @@ public class PopupMMO extends GenericPopup {
private int center_x = 427 / 2;
private int center_y = 240 / 2;
public PopupMMO(Player player, PlayerProfile PP, mcMMO plugin) {
public PopupMMO(Player player, PlayerProfile PP, McMMO plugin) {
//240, 427 are the bottom right
mcMMO_label.setText(ChatColor.GOLD + "~mcMMO Menu~"); //TODO: Needs more locale

View File

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

View File

@ -24,7 +24,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.metadata.FixedMetadataValue;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -43,9 +43,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users;
public class EntityListener implements Listener {
private final mcMMO plugin;
private final McMMO plugin;
public EntityListener(final mcMMO plugin) {
public EntityListener(final McMMO plugin) {
this.plugin = plugin;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ import java.util.Map.Entry;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Combat;
@ -71,7 +71,7 @@ public class BleedTimer implements Runnable {
private void updateBleedList() {
if (lock) {
mcMMO.p.getLogger().warning("mcBleedTimer attempted to update the bleedList but the list was locked!");
McMMO.p.getLogger().warning("mcBleedTimer attempted to update the bleedList but the list was locked!");
}
else {
bleedList.keySet().removeAll(bleedRemoveList);

View File

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

View File

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

View File

@ -2,12 +2,12 @@ package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
public class SaveTimer implements Runnable {
private final mcMMO plugin;
private final McMMO plugin;
public SaveTimer(final mcMMO plugin) {
public SaveTimer(final McMMO plugin) {
this.plugin = plugin;
}

View File

@ -2,7 +2,7 @@ package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.datatypes.AbilityType;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -10,9 +10,9 @@ import com.gmail.nossr50.util.Skills;
import com.gmail.nossr50.util.Users;
public class SkillMonitor implements Runnable {
private final mcMMO plugin;
private final McMMO plugin;
public SkillMonitor(final mcMMO plugin) {
public SkillMonitor(final McMMO plugin) {
this.plugin = plugin;
}

View File

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

View File

@ -18,7 +18,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -202,7 +202,7 @@ public class Taming {
* @param type Type of animal to summon
* @param player Player summoning the animal
*/
public static void animalSummon(EntityType type, Player player, mcMMO plugin) {
public static void animalSummon(EntityType type, Player player, McMMO plugin) {
ItemStack item = player.getItemInHand();
Material summonItem = null;
int summonAmount = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ import org.getspout.spoutapi.player.SpoutPlayer;
import org.getspout.spoutapi.sound.SoundEffect;
import org.getspout.spoutapi.sound.SoundManager;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
public class SpoutSounds {
@ -30,7 +30,7 @@ public class SpoutSounds {
*
* @param player The player who repaired an item
*/
public static void playRepairNoise(Player player, mcMMO plugin) {
public static void playRepairNoise(Player player, McMMO plugin) {
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
@ -43,7 +43,7 @@ public class SpoutSounds {
*
* @param player The player who leveled up
*/
protected static void playLevelUpNoise(Player player, mcMMO plugin) {
protected static void playLevelUpNoise(Player player, McMMO plugin) {
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);

View File

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

View File

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

View File

@ -9,7 +9,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Properties;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.DatabaseUpdate;
import com.gmail.nossr50.runnables.SQLReconnect;
@ -19,10 +19,10 @@ public class Database {
private static String connectionString = "jdbc:mysql://" + Config.getInstance().getMySQLServerName() + ":" + Config.getInstance().getMySQLServerPort() + "/" + Config.getInstance().getMySQLDatabaseName() + "?user=" + Config.getInstance().getMySQLUserName() + "&password=" + Config.getInstance().getMySQLUserPassword();
private static String tablePrefix = Config.getInstance().getMySQLTablePrefix();
private static Connection conn = null;
private static mcMMO plugin = null;
private static McMMO plugin = null;
private static long reconnectTimestamp = 0;
public Database(mcMMO instance) {
public Database(McMMO instance) {
plugin = instance;
connect(); //Connect to MySQL

View File

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

View File

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

View File

@ -11,7 +11,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.PluginManager;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
@ -110,10 +110,10 @@ public class Misc {
//Support for NoCheat
if (shouldArmSwing) {
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
mcMMO.p.getServer().getPluginManager().callEvent(armswing);
McMMO.p.getServer().getPluginManager().callEvent(armswing);
}
PluginManager pluginManger = mcMMO.p.getServer().getPluginManager();
PluginManager pluginManger = McMMO.p.getServer().getPluginManager();
FakeBlockDamageEvent damageEvent = new FakeBlockDamageEvent(player, block, player.getItemInHand(), true);
pluginManger.callEvent(damageEvent);
@ -247,7 +247,7 @@ public class Misc {
// We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
mcMMO.p.getServer().getPluginManager().callEvent(event);
McMMO.p.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;

View File

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

View File

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

View File

@ -13,7 +13,7 @@ import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.block.Block;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.McMMO;
public class HashChunkletManager implements ChunkletManager {
private HashMap<String, ChunkletStore> store = new HashMap<String, ChunkletStore>();
@ -229,7 +229,7 @@ public class HashChunkletManager implements ChunkletManager {
} catch (IOException ex) {
if (ex instanceof EOFException) {
// EOF should only happen on Chunklets that somehow have been corrupted.
mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read, data in this are will be lost.");
McMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read, data in this are will be lost.");
return ChunkletStoreFactory.getChunkletStore();
}
ex.printStackTrace();

View File

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