From 6708947332d5fef65271eda5dc6b764a44e3e972 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 24 Feb 2012 01:46:34 -0800 Subject: [PATCH] Tree Feller is faster. Added limit to tree feller. Added Jungle Tree to Woodcutting XP Tables. Renamed Pine to Oak. Modified default Woodcutting XP Tables. --- Changelog.txt | 4 ++ .../gmail/nossr50/config/LoadProperties.java | 12 ++-- .../com/gmail/nossr50/skills/Unarmed.java | 2 + .../com/gmail/nossr50/skills/WoodCutting.java | 60 +++++++++++++++---- src/main/resources/config.yml | 7 ++- .../resources/locale/locale_de.properties | 3 +- .../resources/locale/locale_en_us.properties | 3 +- .../resources/locale/locale_es_es.properties | 3 +- .../resources/locale/locale_fi.properties | 3 +- .../resources/locale/locale_fr.properties | 3 +- .../resources/locale/locale_nl.properties | 3 +- .../resources/locale/locale_pl.properties | 3 +- .../resources/locale/locale_pt_br.properties | 3 +- .../resources/locale/locale_ru.properties | 3 +- 14 files changed, 84 insertions(+), 28 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 2eedd80f4..2d33c47f9 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,11 +10,13 @@ Key: Version 1.3.00-dev + Added ability to customize drops for Excavation skill + Added ability to customize drops for Fishing skill + + Added jungle trees to Woodcutting XP tables + Added player notification for when they stop Bleeding + Added configuration option to control mcMMO reporting damage events + Added hunger regain bonuses to Herbalism skill + Added Blast Mining subskills to Mining + Added Fast Food Service subskill to Taming + + Added size limit to Tree Feller in config as Tree Feller Threshold + Re-added mcMMO reporting damage events = Fixed Leaf Blower preventing the use of shears to collect leaves = Fixed Green Thumb & Green Terra not consuming or requiring seeds to replant Wheat @@ -26,6 +28,8 @@ Version 1.3.00-dev = Prettied up new config files = Various skill function optimizations ! Changed mcMMO user information to be stored for 2 minutes after log out to reduce lag on rejoins + ! Changed default values of Woodcutting XP tables + ! Changed 'Pine' to be renamed 'Oak' in Woodcutting XP tables ! Changed the name of Unarmed Apprentice/Mastery to Iron Arm Style ! Changed Unarmed to start with a +3 DMG bonus from Iron Arm Style to make leveling it more viable ! Changed Unarmed to gain bonus damage every 50 skill levels diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index d2978c70c..6fd1471ea 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -56,8 +56,8 @@ public class LoadProperties { MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone, nIron, nGold, nDiamond, locale, nString, nLeather; - public static int mtameWolf, mshearing, mmilkCow, mfishing, xpbar_x, xpbar_y, xpicon_x, xpicon_y, - chimaeraId, msandstone, mbase, mpine, mbirch, mspruce, mmelon, + public static int treeFellerThreshold, mjungle, mtameWolf, mshearing, mmilkCow, mfishing, xpbar_x, xpbar_y, xpicon_x, xpicon_y, + chimaeraId, msandstone, mbase, moak, mbirch, mspruce, mmelon, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier, @@ -250,9 +250,10 @@ public class LoadProperties { mvines = readInteger("Experience.Herbalism.Vines", 10); herbalismHungerBonus = readBoolean("Skills.Herbalism.Hunger_Bonus", true); - mpine = readInteger("Experience.Woodcutting.Pine", 70); - mbirch = readInteger("Experience.Woodcutting.Birch", 80); - mspruce = readInteger("Experience.Woodcutting.Spruce", 90); + moak = readInteger("Experience.Woodcutting.Oak", 70); + mbirch = readInteger("Experience.Woodcutting.Birch", 90); + mspruce = readInteger("Experience.Woodcutting.Spruce", 80); + mjungle = readInteger("Experience.Woodcutting.Jungle", 100); mgold = readInteger("Experience.Mining.Gold", 250); mdiamond = readInteger("Experience.Mining.Diamond", 750); @@ -279,6 +280,7 @@ public class LoadProperties { greenTerraCooldown = readInteger("Abilities.Cooldowns.Green_Terra", 240); superBreakerCooldown = readInteger("Abilities.Cooldowns.Super_Breaker", 240); gigaDrillBreakerCooldown = readInteger("Abilities.Cooldowns.Giga_Drill_Breaker", 240); + treeFellerThreshold = readInteger("Abilities.Limits.Tree_Feller_Threshold", 500); treeFellerCooldown = readInteger("Abilities.Cooldowns.Tree_Feller", 240); berserkCooldown = readInteger("Abilities.Cooldowns.Berserk", 240); serratedStrikeCooldown = readInteger("Abilities.Cooldowns.Serrated_Strikes", 240); diff --git a/src/main/java/com/gmail/nossr50/skills/Unarmed.java b/src/main/java/com/gmail/nossr50/skills/Unarmed.java index 7e86c62cc..507aa1cc5 100644 --- a/src/main/java/com/gmail/nossr50/skills/Unarmed.java +++ b/src/main/java/com/gmail/nossr50/skills/Unarmed.java @@ -62,6 +62,7 @@ public class Unarmed { } } } + public static void unarmedBonus(Player attacker, EntityDamageByEntityEvent event) { PlayerProfile PPa = Users.getProfile(attacker); @@ -75,6 +76,7 @@ public class Unarmed { event.setDamage(event.getDamage()+bonus); } + public static void disarmProcCheck(Player attacker, Player defender) { PlayerProfile PP = Users.getProfile(attacker); diff --git a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java index 3c994c183..cd9c768f0 100644 --- a/src/main/java/com/gmail/nossr50/skills/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/WoodCutting.java @@ -60,7 +60,18 @@ public class WoodCutting private static void removeBlocks(ArrayList toBeFelled, Player player, PlayerProfile PP, mcMMO plugin) { + if(toBeFelled.size() > LoadProperties.treeFellerThreshold) + { + player.sendMessage(mcLocale.getString("Skills.Woodcutting.TreeFellerThreshold")); + return; + } int durabilityLoss = 0, xp = 0; + //Prepare ItemStacks + ItemStack item; + ItemStack oak = new ItemStack(Material.LOG, 1, (byte)0, (byte)0); + ItemStack spruce = new ItemStack(Material.LOG, 1, (byte)0, (byte)1); + ItemStack birch = new ItemStack(Material.LOG, 1, (byte)0, (byte)2); + ItemStack jungle = new ItemStack(Material.LOG, 1, (byte)0, (byte)3); for(Block x : toBeFelled) { @@ -72,18 +83,35 @@ public class WoodCutting { if(x.getType() == Material.LOG) { - byte type = x.getData(); - ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type); + switch(x.getData()) + { + case 0: + item = oak; + break; + case 1: + item = spruce; + break; + case 2: + item = birch; + break; + case 3: + item = jungle; + break; + default: + item = oak; + break; + } + + //ItemStack item = new ItemStack(x.getType(), 1, (byte)0, type); if(!plugin.misc.blockWatchList.contains(x)) { WoodCutting.woodCuttingProcCheck(player, x); - switch(x.getData()) { case 0: - xp += LoadProperties.mpine; + xp += LoadProperties.moak; break; case 1: xp += LoadProperties.mspruce; @@ -91,23 +119,25 @@ public class WoodCutting case 2: xp += LoadProperties.mbirch; break; + case 3: + xp += LoadProperties.mjungle; + break; } } - + + //Remove the block + x.setType(Material.AIR); + //Drop the block x.getWorld().dropItemNaturally(x.getLocation(), item); - //Remove the block - x.setData((byte) 0); - x.setType(Material.AIR); - //Damage the tool more if the Tree is larger durabilityLoss++; } else if(x.getType() == Material.LEAVES) { Material mat = Material.SAPLING; - ItemStack item = new ItemStack(mat, 1, (short)0, (byte)(x.getData()-8)); + item = new ItemStack(mat, 1, (short)0, (byte)(x.getData()-8)); //90% chance to drop sapling m.mcRandomDropItem(x.getLocation(), item, 90); @@ -135,6 +165,7 @@ public class WoodCutting } } } + private static boolean treeFellerCompatible(Block block) { return block.getType() == Material.LOG || block.getType() == Material.LEAVES || block.getType() == Material.AIR; @@ -143,7 +174,9 @@ public class WoodCutting private static void processTreeFelling(Block currentBlock, World world, ArrayList toBeFelled) { int x = currentBlock.getX(), y = currentBlock.getY(), z = currentBlock.getZ(); - toBeFelled.add(currentBlock); + + if(currentBlock.getType() == Material.LOG || currentBlock.getType() == Material.LEAVES) + toBeFelled.add(currentBlock); //These 2 are to make sure that Tree Feller isn't so aggressive boolean isAirOrLeaves = currentBlock.getType() == Material.LEAVES || currentBlock.getType() == Material.AIR; @@ -244,7 +277,7 @@ public class WoodCutting switch(data) { case 0: - xp += LoadProperties.mpine; + xp += LoadProperties.moak; break; case 1: xp += LoadProperties.mspruce; @@ -252,6 +285,9 @@ public class WoodCutting case 2: xp += LoadProperties.mbirch; break; + case 3: + xp += LoadProperties.mjungle; + break; } if(block.getTypeId() == 17) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index bd2c1b45c..5f3c2834e 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -84,6 +84,8 @@ Abilities: Serrated_Strikes: 240 Tree_Feller: 240 Super_Breaker: 240 + Limits: + Tree_Feller_Threshold: 500 Tools: Durability_Loss_Enabled: true Durability_Loss: 2 @@ -187,9 +189,10 @@ Experience: Excavation: Base: 40 Woodcutting: - Birch: 70 + Oak: 70 Spruce: 80 - Pine: 90 + Birch: 90 + Jungle: 100 Herbalism: Sugar_Cane: 30 Cactus: 30 diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 142bdfcf4..f66030825 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -399,4 +399,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_en_us.properties b/src/main/resources/locale/locale_en_us.properties index 4c6281bea..ff1f0c0e6 100644 --- a/src/main/resources/locale/locale_en_us.properties +++ b/src/main/resources/locale/locale_en_us.properties @@ -394,4 +394,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_es_es.properties b/src/main/resources/locale/locale_es_es.properties index 97f3578f3..91afd9a0b 100644 --- a/src/main/resources/locale/locale_es_es.properties +++ b/src/main/resources/locale/locale_es_es.properties @@ -392,4 +392,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_fi.properties b/src/main/resources/locale/locale_fi.properties index e103985b7..aaa19aa89 100644 --- a/src/main/resources/locale/locale_fi.properties +++ b/src/main/resources/locale/locale_fi.properties @@ -381,4 +381,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_fr.properties b/src/main/resources/locale/locale_fr.properties index 3c8ad4699..db3a56008 100644 --- a/src/main/resources/locale/locale_fr.properties +++ b/src/main/resources/locale/locale_fr.properties @@ -392,4 +392,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_nl.properties b/src/main/resources/locale/locale_nl.properties index c465acc1a..671b37e3c 100644 --- a/src/main/resources/locale/locale_nl.properties +++ b/src/main/resources/locale/locale_nl.properties @@ -398,4 +398,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_pl.properties b/src/main/resources/locale/locale_pl.properties index 428c994e6..eb2746a16 100644 --- a/src/main/resources/locale/locale_pl.properties +++ b/src/main/resources/locale/locale_pl.properties @@ -392,4 +392,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_pt_br.properties b/src/main/resources/locale/locale_pt_br.properties index a7ef478ef..8b9616b4c 100644 --- a/src/main/resources/locale/locale_pt_br.properties +++ b/src/main/resources/locale/locale_pt_br.properties @@ -400,4 +400,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file diff --git a/src/main/resources/locale/locale_ru.properties b/src/main/resources/locale/locale_ru.properties index d011821f1..45b65be69 100644 --- a/src/main/resources/locale/locale_ru.properties +++ b/src/main/resources/locale/locale_ru.properties @@ -384,4 +384,5 @@ m.BlastMining7 = +35% ore yield, no debris, triple drops m.BlastMining8 = +40% ore yield, no debris, triple drops Skills.AdeptStone=[[DARK_RED]]You're not skilled enough to repair Stone. Skills.AdeptIron=[[DARK_RED]]You're not skilled enough to repair Iron. -Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. \ No newline at end of file +Skills.AdeptGold=[[DARK_RED]]You're not skilled enough to repair Gold. +Skills.Woodcutting.TreeFellerThreshold=[[RED]]That tree is too large! \ No newline at end of file