diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index b723dc325..22ddd8cec 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 0.8.19 + Fixed being able to excavate placed blocks + Added toggle option to mining requiring a pickaxe + Added toggle option to woodcutting requiring an axe + PVP interactions now reward XP based on the damage caused (this is effected by skills) + PVP XP gain can be disabled in the configuration file + PVP XP has a modifier, increase the modifier for higher XP rewards from PVP combat +Version 0.8.18 + Fixed sandstone not being watched for exploitation Version 0.8.17 mcmmo.users moved to plugins/mcMMO/ Snowballs and Eggs will no longer trigger Ignition diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index 0b73e8e87..0e73a87d9 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -54,14 +54,27 @@ public class mcBlockListener extends BlockListener { * MINING */ if(player != null && dmg == 2 && !mcConfig.getInstance().isBlockWatched(block)){ - if(mcm.getInstance().isMiningPick(inhand) && mcPermissions.getInstance().mining(player)) + if(mcPermissions.getInstance().mining(player)){ + if(mcLoadProperties.miningrequirespickaxe){ + if(mcm.getInstance().isMiningPick(inhand)) mcMining.getInstance().miningBlockCheck(player, block); + } else { + mcMining.getInstance().miningBlockCheck(player, block); + } + } /* * WOOD CUTTING */ - if(player != null && mcm.getInstance().isAxes(inhand) && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){ - mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc); - mcUsers.getProfile(player).addWoodcuttingGather(7); + if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){ + if(mcLoadProperties.woodcuttingrequiresaxe){ + if(mcm.getInstance().isAxes(inhand)){ + mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc); + mcUsers.getProfile(player).addWoodcuttingGather(7); + } + } else { + mcWoodCutting.getInstance().woodCuttingProcCheck(player, block, loc); + mcUsers.getProfile(player).addWoodcuttingGather(7); + } /* * IF PLAYER IS USING TREEFELLER */ diff --git a/mcMMO/com/gmail/nossr50/mcCombat.java b/mcMMO/com/gmail/nossr50/mcCombat.java index fdfc0c86d..9b930a275 100644 --- a/mcMMO/com/gmail/nossr50/mcCombat.java +++ b/mcMMO/com/gmail/nossr50/mcCombat.java @@ -92,6 +92,47 @@ public class mcCombat { } } } + /* + * PVP XP + */ + if(attacker != null && defender != null && mcLoadProperties.pvpxp && !mcParty.getInstance().inSameParty(attacker, defender)){ + if(mcm.getInstance().isAxes(attacker.getItemInHand())) + mcUsers.getProfile(attacker).addAxesGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); + if(mcm.getInstance().isSwords(attacker.getItemInHand())) + mcUsers.getProfile(attacker).addSwordsGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); + if(attacker.getItemInHand().getTypeId() == 0) + mcUsers.getProfile(attacker).addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); + } + /* + * CHECK FOR LEVEL UPS + */ + if(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){ + int skillups = 0; + while(mcUsers.getProfile(attacker).getSwordsGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("swords")){ + skillups++; + mcUsers.getProfile(attacker).removeSwordsGather(mcUsers.getProfile(attacker).getXpToLevel("swords")); + mcUsers.getProfile(attacker).skillUpSwords(1); + } + attacker.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getSwords()+")"); + } + if(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){ + int skillups = 0; + while(mcUsers.getProfile(attacker).getAxesGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("axes")){ + skillups++; + mcUsers.getProfile(attacker).removeAxesGather(mcUsers.getProfile(attacker).getXpToLevel("axes")); + mcUsers.getProfile(attacker).skillUpAxes(1); + } + attacker.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getAxes()+")"); + } + if(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){ + int skillups = 0; + while(mcUsers.getProfile(attacker).getUnarmedGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("unarmed")){ + skillups++; + mcUsers.getProfile(attacker).removeUnarmedGather(mcUsers.getProfile(attacker).getXpToLevel("unarmed")); + mcUsers.getProfile(attacker).skillUpUnarmed(1); + } + attacker.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getUnarmed()+")"); + } } } public void playerVersusSquidChecks(EntityDamageByEntityEvent event, Player attacker, Entity x, int type){ @@ -393,15 +434,6 @@ public class mcCombat { if(x instanceof PigZombie) mcUsers.getProfile(attacker).addArcheryGather(7); } - if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){ - int skillups = 0; - while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){ - skillups++; - mcUsers.getProfile(attacker).removeArcheryGather(mcUsers.getProfile(attacker).getXpToLevel("archery")); - mcUsers.getProfile(attacker).skillUpArchery(1); - } - attacker.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getArchery()+")"); - } } /* * Defender is Animals @@ -454,6 +486,12 @@ public class mcCombat { event.setCancelled(true); return; } + } + /* + * PVP XP + */ + if(mcLoadProperties.pvpxp && !mcParty.getInstance().inSameParty(attacker, defender)){ + mcUsers.getProfile(attacker).addArcheryGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); } Location loc = defender.getLocation(); if(Math.random() * 10 > 5){ @@ -490,6 +528,15 @@ public class mcCombat { event.setDamage(calculateDamage(event, 5)); } } + if(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){ + int skillups = 0; + while(mcUsers.getProfile(attacker).getArcheryGatherInt() >= mcUsers.getProfile(attacker).getXpToLevel("archery")){ + skillups++; + mcUsers.getProfile(attacker).removeArcheryGather(mcUsers.getProfile(attacker).getXpToLevel("archery")); + mcUsers.getProfile(attacker).skillUpArchery(1); + } + attacker.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+skillups+"."+" Total ("+mcUsers.getProfile(attacker).getArchery()+")"); + } } } public boolean simulateUnarmedProc(Player player){ diff --git a/mcMMO/com/gmail/nossr50/mcLoadProperties.java b/mcMMO/com/gmail/nossr50/mcLoadProperties.java index f219e0208..d97c86448 100644 --- a/mcMMO/com/gmail/nossr50/mcLoadProperties.java +++ b/mcMMO/com/gmail/nossr50/mcLoadProperties.java @@ -1,15 +1,19 @@ package com.gmail.nossr50; public class mcLoadProperties { - public static Boolean pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; + public static Boolean pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; public static String mcmmo, mcc, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn; - public static int repairdiamondlevel, globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier; + public static int pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier; public static void loadMain(){ String propertiesFile = mcMMO.maindirectory + "mcmmo.properties"; mcProperties properties = new mcProperties(propertiesFile); properties.load(); + pvpxp = properties.getBoolean("pvpGivesXP", true); + pvpxprewardmodifier = properties.getInteger("pvpXpRewardModifier", 1); + miningrequirespickaxe = properties.getBoolean("miningRequiresPickaxe", true); + woodcuttingrequiresaxe = properties.getBoolean("woodcuttingRequiresAxe", true); repairdiamondlevel = properties.getInteger("repairdiamondlevel", 50); /* * EXPERIENCE RATE MODIFIER diff --git a/mcMMO/com/gmail/nossr50/mcMining.java b/mcMMO/com/gmail/nossr50/mcMining.java index 3784ac009..989e18e49 100644 --- a/mcMMO/com/gmail/nossr50/mcMining.java +++ b/mcMMO/com/gmail/nossr50/mcMining.java @@ -25,7 +25,7 @@ public class mcMining { byte damage = 0; ItemStack item = new ItemStack(mat, 1, (byte)0, damage); if(block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16) - loc.getWorld().dropItemNaturally(loc, item); + loc.getWorld().dropItemNaturally(loc, item); if(block.getTypeId() == 73 || block.getTypeId() == 74){ mat = Material.getMaterial(331); item = new ItemStack(mat, 1, (byte)0, damage); diff --git a/mcMMO/com/gmail/nossr50/mcm.java b/mcMMO/com/gmail/nossr50/mcm.java index 0a2c0ada3..57eda619a 100644 --- a/mcMMO/com/gmail/nossr50/mcm.java +++ b/mcMMO/com/gmail/nossr50/mcm.java @@ -94,7 +94,7 @@ public class mcm { } public boolean shouldBeWatched(Block block){ int id = block.getTypeId(); - if(id == 21 || id == 15 || id == 14 || id == 56 || id == 38 || id == 37 || id == 39 || id == 40){ + if(id == 2 || id == 3 || id == 12 || id == 13 || id == 21 || id == 15 || id == 14 || id == 56 || id == 38 || id == 37 || id == 39 || id == 40 || id == 24){ return true; } else { return false; diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index af1640321..22fb745a4 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,3 +1,3 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 0.8.17 \ No newline at end of file +version: 0.8.19 \ No newline at end of file