mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Well this should fix the issues with config, but I hate it.
This commit is contained in:
@ -42,7 +42,7 @@ public class MmoupdateCommand implements CommandExecutor {
|
||||
* Convert FlatFile data to MySQL data.
|
||||
*/
|
||||
private void convertToMySQL() {
|
||||
if (!Config.getUseMySQL()) {
|
||||
if (!Config.getInstance().getUseMySQL()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class XprateCommand implements CommandExecutor {
|
||||
private final mcMMO plugin;
|
||||
private static int oldrate = Config.xpGainMultiplier;
|
||||
private static int oldrate = Config.getInstance().xpGainMultiplier;
|
||||
public static boolean xpevent = false;
|
||||
|
||||
public XprateCommand (mcMMO plugin) {
|
||||
@ -39,10 +39,10 @@ public class XprateCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
xpevent = !xpevent;
|
||||
Config.xpGainMultiplier = oldrate;
|
||||
Config.getInstance().xpGainMultiplier = oldrate;
|
||||
}
|
||||
else {
|
||||
Config.xpGainMultiplier = oldrate;
|
||||
Config.getInstance().xpGainMultiplier = oldrate;
|
||||
}
|
||||
}
|
||||
else if (m.isInt(args[0])) {
|
||||
@ -56,7 +56,7 @@ public class XprateCommand implements CommandExecutor {
|
||||
|
||||
case 2:
|
||||
if (m.isInt(args[0])) {
|
||||
oldrate = Config.xpGainMultiplier;
|
||||
oldrate = Config.getInstance().xpGainMultiplier;
|
||||
|
||||
if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) {
|
||||
xpevent = Boolean.valueOf(args[1]);
|
||||
@ -65,16 +65,16 @@ public class XprateCommand implements CommandExecutor {
|
||||
sender.sendMessage(usage3);
|
||||
}
|
||||
|
||||
Config.xpGainMultiplier = m.getInt(args[0]);
|
||||
Config.getInstance().xpGainMultiplier = m.getInt(args[0]);
|
||||
|
||||
if (xpevent) {
|
||||
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
||||
x.sendMessage(mcLocale.getString("Commands.xprate.started.0"));
|
||||
x.sendMessage(mcLocale.getString("Commands.xprate.started.1", new Object[] {Config.xpGainMultiplier}));
|
||||
x.sendMessage(mcLocale.getString("Commands.xprate.started.1", new Object[] {Config.getInstance().xpGainMultiplier}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sender.sendMessage("The XP RATE was modified to " + Config.xpGainMultiplier); //TODO: Locale
|
||||
sender.sendMessage("The XP RATE was modified to " + Config.getInstance().xpGainMultiplier); //TODO: Locale
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -18,8 +18,8 @@ public class McmmoCommand implements CommandExecutor {
|
||||
String[] mcSplit = description.split(",");
|
||||
sender.sendMessage(mcSplit);
|
||||
|
||||
if (Config.getDonateMessageEnabled()) {
|
||||
if (Config.spoutEnabled && sender instanceof SpoutPlayer) {
|
||||
if (Config.getInstance().getDonateMessageEnabled()) {
|
||||
if (Config.getInstance().spoutEnabled && sender instanceof SpoutPlayer) {
|
||||
SpoutPlayer sPlayer = (SpoutPlayer) sender;
|
||||
|
||||
sPlayer.sendNotification(ChatColor.YELLOW + "[mcMMO]" + ChatColor.GOLD + " Donate!", ChatColor.GREEN + "nossr50@gmail.com", Material.DIAMOND);
|
||||
|
@ -27,8 +27,8 @@ public class McremoveCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
String playerName;
|
||||
String tablePrefix = Config.getMySQLTablePrefix();
|
||||
String databaseName = Config.getMySQLDatabaseName();
|
||||
String tablePrefix = Config.getInstance().getMySQLTablePrefix();
|
||||
String databaseName = Config.getInstance().getMySQLDatabaseName();
|
||||
String usage = ChatColor.RED + "Proper usage is /mcremove <player>"; //TODO: Needs more locale.
|
||||
String success;
|
||||
|
||||
@ -48,7 +48,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
/* MySQL */
|
||||
if (Config.getUseMySQL()) {
|
||||
if (Config.getInstance().getUseMySQL()) {
|
||||
int userId = 0;
|
||||
userId = mcMMO.database.getInt("SELECT id FROM " + tablePrefix + "users WHERE user = '" + playerName + "'");
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class MctopCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
String usage = ChatColor.RED + "Proper usage is /mctop [skill] [page]"; //TODO: Needs more locale.
|
||||
|
||||
if (!Config.getUseMySQL()) {
|
||||
if (!Config.getInstance().getUseMySQL()) {
|
||||
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
@ -132,7 +132,7 @@ public class MctopCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
private void sqlDisplay(int page, String query, CommandSender sender) {
|
||||
String tablePrefix = Config.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 ");
|
||||
|
||||
if (query == "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing") {
|
||||
|
@ -44,8 +44,8 @@ public class PtpCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PP.getRecentlyHurt() + (Config.getPTPCommandCooldown() * 1000) > System.currentTimeMillis()) {
|
||||
player.sendMessage(mcLocale.getString("Party.Teleport.Hurt", new Object[] { Config.getPTPCommandCooldown() }));
|
||||
if (PP.getRecentlyHurt() + (Config.getInstance().getPTPCommandCooldown() * 1000) > System.currentTimeMillis()) {
|
||||
player.sendMessage(mcLocale.getString("Party.Teleport.Hurt", new Object[] { Config.getInstance().getPTPCommandCooldown() }));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class RepairCommand implements CommandExecutor {
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.0"), mcLocale.getString("Repair.Effect.1") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.2"), mcLocale.getString("Repair.Effect.3") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.4"), mcLocale.getString("Repair.Effect.5") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.6", new Object[] { Config.getRepairDiamondLevelRequirement() }), mcLocale.getString("Repair.Effect.7") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.6", new Object[] { Config.getInstance().getRepairDiamondLevelRequirement() }), mcLocale.getString("Repair.Effect.7") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.8"), mcLocale.getString("Repair.Effect.9") }));
|
||||
|
||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
||||
|
@ -46,8 +46,8 @@ public class TamingCommand implements CommandExecutor {
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.10"), mcLocale.getString("Taming.Effect.11") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.12"), mcLocale.getString("Taming.Effect.13") }));
|
||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.16"), mcLocale.getString("Taming.Effect.17") }));
|
||||
player.sendMessage(mcLocale.getString("Taming.Effect.14", new Object[] { Config.getTamingCOTWOcelotCost() }));
|
||||
player.sendMessage(mcLocale.getString("Taming.Effect.15", new Object[] { Config.getTamingCOTWWolfCost() }));
|
||||
player.sendMessage(mcLocale.getString("Taming.Effect.14", new Object[] { Config.getInstance().getTamingCOTWOcelotCost() }));
|
||||
player.sendMessage(mcLocale.getString("Taming.Effect.15", new Object[] { Config.getInstance().getTamingCOTWWolfCost() }));
|
||||
|
||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class MchudCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Config.spoutEnabled || !Config.getSpoutXPBarEnabled()) {
|
||||
if (!Config.getInstance().spoutEnabled || !Config.getInstance().getSpoutXPBarEnabled()) {
|
||||
sender.sendMessage(mcLocale.getString("Commands.Disabled"));
|
||||
return true;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class XplockCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Config.spoutEnabled || !Config.getSpoutXPBarEnabled() || !Config.getCommandXPLockEnabled()) {
|
||||
if (!Config.getInstance().spoutEnabled || !Config.getInstance().getSpoutXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
|
||||
sender.sendMessage(mcLocale.getString("Commands.Disabled"));
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user