diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index ef47c4836..9509d0e7d 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,5 +1,14 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code +Version 1.0.40 +Fixed errors if your server wasn't running BukkitContrib + +Version 1.0.39 +mcMMO won't auto-download and auto-run BukkitContrib anymore + +Version 1.0.38 +Commented code for the half-finished Infernal Pick subskill (Whoops) + Version 1.0.37 The donation message in /mcmmo is now toggle-able The anvil message now only gets shown the first time you place an anvil (after login) diff --git a/mcMMO/com/gmail/nossr50/config/LoadProperties.java b/mcMMO/com/gmail/nossr50/config/LoadProperties.java index 8b2e1a13c..803925809 100644 --- a/mcMMO/com/gmail/nossr50/config/LoadProperties.java +++ b/mcMMO/com/gmail/nossr50/config/LoadProperties.java @@ -5,7 +5,7 @@ import org.bukkit.util.config.Configuration; public class LoadProperties { - public static Boolean donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; + public static Boolean contribEnabled, donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable, mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable, whoisEnable, statsEnable, addxpEnable, ptpEnable, mmoeditEnable, clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable, mcrefreshEnable, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp, party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond, locale; public static int archeryLimit, chimaeraId, msandstone, mcocoa, water_thunder, cure_self, cure_other, mbones, msulphur, mslowsand, mmushroom2, mglowstone2, mmusic, mdiamond2, mbase, mapple, meggs, mcake, mpine, mbirch, mspruce, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapus, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier, superBreakerCooldown = 240, greenTerraCooldown = 240, gigaDrillBreakerCooldown = 240, treeFellerCooldown = 240, berserkCooldown = 240, serratedStrikeCooldown = 240, skullSplitterCooldown = 240, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, sorceryxpmodifier = 2, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier, rWood, rStone, rIron, rGold, rDiamond; public String directory = "plugins/mcMMO/"; @@ -280,7 +280,10 @@ public class LoadProperties skullSplitterCooldown = readInteger("Abilities.Cooldowns.Skull_Splitter", 240); MySQLserverName = readString("MySQL.Server.Address", "localhost"); - MySQLdbPass = readString("MySQL.Database.User.Password", ""); + if(readString("MySQL.Database.User.Password", null) != null) + MySQLdbPass = readString("MySQL.Database.User.Password", null); + else + MySQLdbPass = ""; MySQLdbName = readString("MySQL.Database.Name", "DatabaseName"); MySQLuserName = readString("MySQL.Database.User.Name", "UserName"); diff --git a/mcMMO/com/gmail/nossr50/contrib/contribStuff.java b/mcMMO/com/gmail/nossr50/contrib/contribStuff.java index 7981b7a00..bd314f507 100644 --- a/mcMMO/com/gmail/nossr50/contrib/contribStuff.java +++ b/mcMMO/com/gmail/nossr50/contrib/contribStuff.java @@ -12,6 +12,7 @@ import org.bukkitcontrib.sound.SoundManager; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; +import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -19,6 +20,8 @@ public class contribStuff { public static void playSoundForPlayer(SoundEffect effect, Player player, Location location) { + if(!LoadProperties.contribEnabled) + return; //Contrib stuff ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); SoundManager SM = BukkitContrib.getSoundManager(); diff --git a/mcMMO/com/gmail/nossr50/listeners/mcBlockListener.java b/mcMMO/com/gmail/nossr50/listeners/mcBlockListener.java index c2619b496..e4a1ca3f7 100644 --- a/mcMMO/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/listeners/mcBlockListener.java @@ -57,16 +57,27 @@ public class mcBlockListener extends BlockListener { } if(block.getTypeId() == 42 && LoadProperties.anvilmessages) { - ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); PlayerProfile PP = Users.getProfile(player); - if(cPlayer.isBukkitContribEnabled()) + if(LoadProperties.contribEnabled) + { + ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); + if(cPlayer.isBukkitContribEnabled()) + { + if(!PP.getPlacedAnvil()) + { + cPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.IRON_BLOCK); + PP.togglePlacedAnvil(); + } + } + else { if(!PP.getPlacedAnvil()) { - cPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.IRON_BLOCK); + event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$ PP.togglePlacedAnvil(); } } + } else { if(!PP.getPlacedAnvil()) @@ -118,14 +129,14 @@ public class mcBlockListener extends BlockListener { if(PP.getSkillLevel(SkillType.MINING) >= 500) Mining.miningBlockCheck(false, player, block, plugin); else - Mining.miningBlockCheck(true, player, block, plugin); + Mining.miningBlockCheck(false, player, block, plugin); } } else { if(PP.getSkillLevel(SkillType.MINING) >= 500) Mining.miningBlockCheck(false, player, block, plugin); else - Mining.miningBlockCheck(true, player, block, plugin); + Mining.miningBlockCheck(false, player, block, plugin); } } /* @@ -271,6 +282,7 @@ public class mcBlockListener extends BlockListener { Unarmed.berserkActivationCheck(player, plugin); + /* if(mcPermissions.getInstance().mining(player) && Mining.canBeSuperBroken(block) && m.blockBreakSimulate(block, player, plugin) && PP.getSkillLevel(SkillType.MINING) >= 250 && block.getType() != Material.STONE && m.isMiningPick(inhand)) @@ -297,6 +309,7 @@ public class mcBlockListener extends BlockListener { } } } + */ /* * TREE FELLAN STUFF diff --git a/mcMMO/com/gmail/nossr50/mcMMO.java b/mcMMO/com/gmail/nossr50/mcMMO.java index ae198f007..801e3de16 100644 --- a/mcMMO/com/gmail/nossr50/mcMMO.java +++ b/mcMMO/com/gmail/nossr50/mcMMO.java @@ -91,6 +91,11 @@ public class mcMMO extends JavaPlugin */ PluginManager pm = getServer().getPluginManager(); + + if(pm.getPlugin("BukkitContrib") != null) + LoadProperties.contribEnabled = true; + else + LoadProperties.contribEnabled = false; //Player Stuff pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this); @@ -123,17 +128,7 @@ public class mcMMO extends JavaPlugin } else Leaderboard.makeLeaderboards(); //Make the leaderboards - for(Player player : getServer().getOnlinePlayers()){Users.addUser(player);} //In case of reload add all users back into PlayerProfile - - if (pm.getPlugin("BukkitContrib") == null) - try { - download(log, new URL("http://bit.ly/autoupdateBukkitContrib"), new File("plugins/BukkitContrib.jar")); - pm.loadPlugin(new File("plugins" + File.separator + "BukkitContrib.jar")); - pm.enablePlugin(pm.getPlugin("BukkitContrib")); - } catch (final Exception ex) { - log.warning("[mcMMO] Failed to install BukkitContrib, you may have to restart your server or install it manually."); - } - + for(Player player : getServer().getOnlinePlayers()){Users.addUser(player);} //In case of reload add all users back into PlayerProfile System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" ); mcMMO_Timer.schedule(new mcTimer(this), (long)0, (long)(1000)); //mcMMO_SpellTimer.schedule(new mcTimerSpells(this), (long)0, (long)(100)); @@ -638,10 +633,17 @@ public class mcMMO extends JavaPlugin { player.sendMessage(x); } - - ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); - if(LoadProperties.donateMessage) - cPlayer.sendNotification("[mcMMO] Donate!", "Paypal nossr50@gmail.com", Material.CAKE); + if(LoadProperties.contribEnabled) + { + ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); + if(LoadProperties.donateMessage) + cPlayer.sendNotification("[mcMMO] Donate!", "Paypal nossr50@gmail.com", Material.CAKE); + } + else + { + if(LoadProperties.donateMessage) + player.sendMessage(ChatColor.GREEN+"If you like my work you can donate via Paypal: nossr50@gmail.com"); + } } else if(LoadProperties.mccEnable && label.equalsIgnoreCase(LoadProperties.mcc)){ player.sendMessage(ChatColor.RED+"---[]"+ChatColor.YELLOW+"mcMMO Commands"+ChatColor.RED+"[]---"); diff --git a/mcMMO/com/gmail/nossr50/skills/Skills.java b/mcMMO/com/gmail/nossr50/skills/Skills.java index f13df4216..6910751e4 100644 --- a/mcMMO/com/gmail/nossr50/skills/Skills.java +++ b/mcMMO/com/gmail/nossr50/skills/Skills.java @@ -309,13 +309,20 @@ public class Skills { //Contrib stuff - ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); - if(cPlayer.isBukkitContribEnabled()) + if(LoadProperties.contribEnabled) { - contribStuff.levelUpNotification(skillType, cPlayer); - } else { - player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); + ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player); + if(cPlayer.isBukkitContribEnabled()) + { + contribStuff.levelUpNotification(skillType, cPlayer); + } else + { + player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); + } } + else + player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)})); + } } diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index d3ce32c99..b468ed35a 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,6 +1,6 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 1.0.37 +version: 1.0.40 commands: mcc: description: Lists mcMMO commands