Another WIP for 1.1.14

This commit is contained in:
nossr50 2011-09-05 17:02:11 -07:00
parent 5f8d5cfd69
commit cee3ba5281
6 changed files with 989 additions and 967 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ public class LoadProperties
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,
toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, excavationRequiresShovel, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone,
slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static String xplock, MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp,
@ -322,6 +322,7 @@ public class LoadProperties
write("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true);
write("Skills.Archery.Fire_Rate_Limiter.Enabled", true);
write("Skills.Archery.Fire_Rate_Limiter.Interval", 1000);
write("Skills.Excavation.Requires_Shovel", true);
write("Skills.Mining.Requires_Pickaxe", true);
write("Skills.Woodcutting.Requires_Axe", true);
@ -478,6 +479,7 @@ public class LoadProperties
pvpxp = readBoolean("XP.PVP.Rewards", true);
pvpxprewardmodifier = readDouble("Experience.Gains.Multiplier.PVP", 1.0);
miningrequirespickaxe = readBoolean("Skills.Mining.Requires_Pickaxe", true);
excavationRequiresShovel = readBoolean("Skills.Excavation.Requires_Shovel", true);
woodcuttingrequiresaxe = readBoolean("Skills.Woodcutting.Requires_Axe", true);
repairdiamondlevel = readInteger("Skills.Repair.Diamond.Level_Required", 50);

View File

@ -901,6 +901,34 @@ public class PlayerProfile
skills.put(skillType, 0);
}
/**
* Adds XP to the player, this ignores skill modifiers
* @param skillType The skill to add XP to
* @param newvalue The amount of XP to add
*/
public void addXPOverride(SkillType skillType, int newvalue)
{
if(skillType == SkillType.ALL)
{
for(SkillType x : SkillType.values())
{
if(x == SkillType.ALL)
continue;
skillsXp.put(x, skillsXp.get(x)+newvalue);
}
} else {
int xp = newvalue;
xp=xp*LoadProperties.xpGainMultiplier;
skillsXp.put(skillType, skillsXp.get(skillType)+xp);
lastgained = skillType;
}
}
/**
* Adds XP to the player, this is affected by skill modifiers
* @param skillType The skill to add XP to
* @param newvalue The amount of XP to add
*/
public void addXP(SkillType skillType, int newvalue)
{
if(skillType == SkillType.ALL)

View File

@ -24,8 +24,6 @@ public class m
* This is probably the most embarrassing part of my code for mcMMO
* I really should find an organized place for these things!
*/
//The lazy way to default to 0
public static String getCapitalized(String target)
{
@ -252,32 +250,19 @@ public class m
public static boolean isSwords(ItemStack is)
{
if(is.getTypeId() == 268 || is.getTypeId() == 267 || is.getTypeId() == 272 || is.getTypeId() == 283 || is.getTypeId() == 276)
{
return true;
} else
{
return false;
}
return is.getTypeId() == 268 || is.getTypeId() == 267 || is.getTypeId() == 272 || is.getTypeId() == 283 || is.getTypeId() == 276;
}
public static boolean isHoe(ItemStack is)
{
int id = is.getTypeId();
if(id == 290 || id == 291 || id == 292 || id == 293 || id == 294)
{
return true;
} else
{
return false;
}
return id == 290 || id == 291 || id == 292 || id == 293 || id == 294;
}
public static boolean isShovel(ItemStack is){
if(is.getTypeId() == 269 || is.getTypeId() == 273 || is.getTypeId() == 277 || is.getTypeId() == 284 || is.getTypeId() == 256){
return true;
} else {
return false;
}
return is.getTypeId() == 269 || is.getTypeId() == 273 || is.getTypeId() == 277 || is.getTypeId() == 284 || is.getTypeId() == 256;
}
public static boolean isAxes(ItemStack is){
if(is.getTypeId() == 271 || is.getTypeId() == 258 || is.getTypeId() == 286 || is.getTypeId() == 279 || is.getTypeId() == 275){
return true;

View File

@ -137,7 +137,7 @@ public class mcMMO extends JavaPlugin
//Entity Stuff
pm.registerEvent(Event.Type.ENTITY_TARGET, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.High, this);
pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Monitor, this);
pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this);
//Spout Stuff

View File

@ -59,6 +59,9 @@ public class Excavation
}
public static void excavationProcCheck(byte data, Material type, Location loc, Player player)
{
if(LoadProperties.excavationRequiresShovel && !m.isShovel(player.getItemInHand()))
return;
PlayerProfile PP = Users.getProfile(player);
ArrayList<ItemStack> is = new ArrayList<ItemStack>();