Version 1.0.40

P.S: BukkitContrib is amazing :)
This commit is contained in:
nossr50 2011-07-20 14:27:59 -07:00
parent 0c71b3acfe
commit 7901402c44
7 changed files with 65 additions and 28 deletions

View File

@ -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)

View File

@ -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");

View File

@ -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();

View File

@ -57,8 +57,10 @@ public class mcBlockListener extends BlockListener {
}
if(block.getTypeId() == 42 && LoadProperties.anvilmessages)
{
ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player);
PlayerProfile PP = Users.getProfile(player);
if(LoadProperties.contribEnabled)
{
ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player);
if(cPlayer.isBukkitContribEnabled())
{
if(!PP.getPlacedAnvil())
@ -76,6 +78,15 @@ public class mcBlockListener extends BlockListener {
}
}
}
else
{
if(!PP.getPlacedAnvil())
{
event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$
PP.togglePlacedAnvil();
}
}
}
}
public void onBlockBreak(BlockBreakEvent event)
@ -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

View File

@ -92,6 +92,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);
pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this);
@ -124,16 +129,6 @@ public class mcMMO extends JavaPlugin
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.");
}
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,11 +633,18 @@ public class mcMMO extends JavaPlugin
{
player.sendMessage(x);
}
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+"[]---");
if(mcPermissions.getInstance().party(player)){

View File

@ -309,13 +309,20 @@ public class Skills {
//Contrib stuff
if(LoadProperties.contribEnabled)
{
ContribPlayer cPlayer = ContribCraftPlayer.getContribPlayer(player);
if(cPlayer.isBukkitContribEnabled())
{
contribStuff.levelUpNotification(skillType, cPlayer);
} else {
} 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)}));
}
}

View File

@ -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