From eccef7d206863f8adcdf07f144aae9e0593cdc19 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 12 Apr 2011 12:12:18 -0700 Subject: [PATCH] 0.9.27 --- mcMMO/Changelog.txt | 8 ++++ mcMMO/com/gmail/nossr50/mcBlockListener.java | 13 ++++-- mcMMO/com/gmail/nossr50/mcHerbalism.java | 45 ++++++++++--------- mcMMO/com/gmail/nossr50/mcMining.java | 2 +- mcMMO/com/gmail/nossr50/mcPlayerListener.java | 2 +- mcMMO/plugin.yml | 2 +- 6 files changed, 44 insertions(+), 28 deletions(-) diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index fa9f7f91b..b0a05c811 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,5 +1,13 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code# +Version 0.9.27 +Fixed Herbalism not properly receiving Triple Drops from Green Terra +Fixed Herbalism not handing out any XP outside of Green Terra +Fixed Herbalism asking for seeds on things that did not require it + +Version 0.9.26 +Fixed Green Terra going off without readiness +Fixed Hoe trying to ready when tilling Grass Version 0.9.25 Fixed issue with anti-exploits and Herbalism diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index cdd706f48..d375d6e74 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -58,8 +58,12 @@ public class mcBlockListener extends BlockListener { /* * HERBALISM */ - if(mcPermissions.getInstance().herbalismAbility(player)&& PP.getGreenTerraMode() && block.getTypeId() == 59 && block.getData() == (byte) 0x07){ + if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && block.getTypeId() == 59 && block.getData() == (byte) 0x07){ mcHerbalism.getInstance().greenTerraCheck(player, block, plugin); + } + //Wheat && Triple drops + if(PP.getGreenTerraMode() && mcHerbalism.getInstance().canBeGreenTerra(block)){ + mcHerbalism.getInstance().herbalismProcCheck(block, player, event); mcHerbalism.getInstance().greenTerraWheat(player, block, event); } @@ -141,11 +145,12 @@ public class mcBlockListener extends BlockListener { /* * HERBALISM */ - if(mcPermissions.getInstance().herbalism(player) && mcHerbalism.getInstance().canBeGreenTerra(block)){ + if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalism(player) && mcHerbalism.getInstance().canBeGreenTerra(block)){ mcHerbalism.getInstance().greenTerraCheck(player, block, plugin); - if(block.getData() != (byte) 5) - mcHerbalism.getInstance().herbalismProcCheck(block, player, event); } + if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5) + mcHerbalism.getInstance().herbalismProcCheck(block, player, event); + //Change the byte back when broken if(block.getData() == 5) block.setData((byte) 0); diff --git a/mcMMO/com/gmail/nossr50/mcHerbalism.java b/mcMMO/com/gmail/nossr50/mcHerbalism.java index 0b6930de0..289375a31 100644 --- a/mcMMO/com/gmail/nossr50/mcHerbalism.java +++ b/mcMMO/com/gmail/nossr50/mcHerbalism.java @@ -26,26 +26,30 @@ public class mcHerbalism { return instance; } public void greenTerraWheat(Player player, Block block, BlockBreakEvent event){ - event.setCancelled(true); - PlayerProfile PP = mcUsers.getProfile(player.getName()); - Material mat = Material.getMaterial(296); - Location loc = block.getLocation(); - ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0); - PP.addHerbalismGather(5 * mcLoadProperties.xpGainMultiplier); - loc.getWorld().dropItemNaturally(loc, is); - herbalismProcCheck(block, player, event); - herbalismProcCheck(block, player, event); - block.setData((byte) 0x03); + if(block.getType() == Material.WHEAT && block.getData() == (byte) 0x07){ + event.setCancelled(true); + PlayerProfile PP = mcUsers.getProfile(player.getName()); + Material mat = Material.getMaterial(296); + Location loc = block.getLocation(); + ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0); + PP.addHerbalismGather(5 * mcLoadProperties.xpGainMultiplier); + loc.getWorld().dropItemNaturally(loc, is); + herbalismProcCheck(block, player, event); + herbalismProcCheck(block, player, event); + block.setData((byte) 0x03); + } } public void greenTerra(Player player, Block block){ - if(!hasSeeds(player) && block.getType() != Material.WHEAT) - player.sendMessage("You need more seeds to spread Green Terra"); - if(hasSeeds(player) && block.getType() != Material.WHEAT){ - removeSeeds(player); - if(block.getType() == Material.DIRT) - block.setType(Material.GRASS); - if(block.getType() == Material.COBBLESTONE) - block.setType(Material.MOSSY_COBBLESTONE); + if(block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT){ + if(!hasSeeds(player)) + player.sendMessage("You need more seeds to spread Green Terra"); + if(hasSeeds(player) && block.getType() != Material.WHEAT){ + removeSeeds(player); + if(block.getType() == Material.DIRT) + block.setType(Material.GRASS); + if(block.getType() == Material.COBBLESTONE) + block.setType(Material.MOSSY_COBBLESTONE); + } } } public Boolean canBeGreenTerra(Block block){ @@ -98,7 +102,7 @@ public class mcHerbalism { ticks++; } - if(!PP.getGreenTerraMode() && PP.getGreenTerraCooldown() == 0){ + if(!PP.getGreenTerraMode() && mcSkills.getInstance().cooldownOver(player, PP.getGreenTerraDeactivatedTimeStamp(), mcLoadProperties.greenTerraCooldown)){ player.sendMessage(ChatColor.GREEN+"**GREEN TERRA ACTIVATED**"); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && mcm.getInstance().getDistance(player.getLocation(), y.getLocation()) < 10) @@ -172,8 +176,7 @@ public class mcHerbalism { } //Sugar Canes if(type == 83){ - mat = Material.getMaterial(block.getTypeId()); - is = new ItemStack(mat, 1, (byte)0, (byte)0); + is = new ItemStack(Material.SUGAR_CANE, 1, (byte)0, (byte)0); if(player != null){ if(Math.random() * 1000 <= PP.getHerbalismInt()){ loc.getWorld().dropItemNaturally(loc, is); diff --git a/mcMMO/com/gmail/nossr50/mcMining.java b/mcMMO/com/gmail/nossr50/mcMining.java index 4663afdb8..a64e115c1 100644 --- a/mcMMO/com/gmail/nossr50/mcMining.java +++ b/mcMMO/com/gmail/nossr50/mcMining.java @@ -41,7 +41,7 @@ public class mcMining { ticks++; } - if(!PP.getSuperBreakerMode() && PP.getSuperBreakerCooldown() == 0){ + if(!PP.getSuperBreakerMode() && mcSkills.getInstance().cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), mcLoadProperties.superBreakerCooldown)){ player.sendMessage(ChatColor.GREEN+"**SUPER BREAKER ACTIVATED**"); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && mcm.getInstance().getDistance(player.getLocation(), y.getLocation()) < 10) diff --git a/mcMMO/com/gmail/nossr50/mcPlayerListener.java b/mcMMO/com/gmail/nossr50/mcPlayerListener.java index f93b5f185..d442d4f25 100644 --- a/mcMMO/com/gmail/nossr50/mcPlayerListener.java +++ b/mcMMO/com/gmail/nossr50/mcPlayerListener.java @@ -109,7 +109,7 @@ public class mcPlayerListener extends PlayerListener { if(mcm.getInstance().abilityBlockCheck(block)) { - if(block != null && mcm.getInstance().isHoe(player.getItemInHand()) && block.getTypeId() != 3){ + if(block != null && mcm.getInstance().isHoe(player.getItemInHand()) && block.getTypeId() != 3 && block.getTypeId() != 2 && block.getTypeId() != 60){ mcSkills.getInstance().hoeReadinessCheck(player); } mcSkills.getInstance().abilityActivationCheck(player); diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index 4f42da846..584961175 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,3 +1,3 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 0.9.25 \ No newline at end of file +version: 0.9.27 \ No newline at end of file