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

View File

@ -1,7 +1,10 @@
Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Version 1.1.14
Due to high demand of mcMMO files, I cannot justify hosting mcMMO content on a webserver, so mcMMO will now behaves like Valve's source games, files are transferred between the Server and client not a webserver. This should be an improvement over the old system.
mcMMO now transfers files between MC Server -> Client rather than Webserver -> Client (By default, you can change this..)
Changed the listener priority for OnEntityDamage from High to Monitor (Should make mcMMO compatible with Worldguards pvp regions among other things)
Added addXpOverride for modders, this will ignore skill modifiers
Added an option for Excavation to require use of a shovel, on by default
The option to change the weburl of mcMMO Images/Sounds has been removed, if you want to customize mcMMO images/sounds you can open mcMMO.jar and replace them there
Made party/admin chat modes more compatible with chat plugins (vChat)
@ -942,3 +945,4 @@ Version 0.2
Version 0.1
Releasing my awesome plugin

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

@ -25,8 +25,6 @@ public class m
* I really should find an organized place for these things!
*/
//The lazy way to default to 0
public static String getCapitalized(String target)
{
String firstLetter = target.substring(0,1);
@ -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>();