From 95899242358208e71fdf64d3ce505122169a8564 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Feb 2012 14:58:24 -0800 Subject: [PATCH] Made Green Terra use Green Thumb for wheat planting. --- .../nossr50/listeners/mcBlockListener.java | 1 - .../com/gmail/nossr50/skills/Herbalism.java | 49 +++++-------------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index ce2dfb46a..a95fce105 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -170,7 +170,6 @@ public class mcBlockListener implements Listener if(PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block)) { Herbalism.herbalismProcCheck(block, player, event, plugin); - Herbalism.greenTerraWheat(player, block, event, plugin); } diff --git a/src/main/java/com/gmail/nossr50/skills/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/Herbalism.java index 4699ece8c..ba4d7dc8d 100644 --- a/src/main/java/com/gmail/nossr50/skills/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/Herbalism.java @@ -74,35 +74,6 @@ public class Herbalism } } - public static void greenTerraWheat(Player player, final Block block, BlockBreakEvent event, mcMMO plugin) - { - if(block.getType() == Material.WHEAT && block.getData() == (byte) 0x07) - { - event.setCancelled(true); - PlayerProfile PP = Users.getProfile(player); - Material mat = Material.getMaterial(296); - Location loc = block.getLocation(); - ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0); - PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player); - m.mcDropItem(loc, is); - - //DROP SOME SEEDS - mat = Material.SEEDS; - is = new ItemStack(mat, 1, (byte)0, (byte)0); - m.mcDropItem(loc, is); - - herbalismProcCheck(block, player, event, plugin); - herbalismProcCheck(block, player, event, plugin); - - Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { - public void run() { - block.setType(Material.CROPS); - block.setData((byte) 0x4); - } - }, 1); - } - } - public static void greenTerra(Player player, Block block){ if(block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT){ if(!hasSeeds(player)) @@ -179,7 +150,7 @@ public class Herbalism } //GREEN THUMB - if(!PP.getGreenTerraMode() && (herbLevel >= 1500 || (Math.random() * 1500 <= herbLevel))) + if(PP.getGreenTerraMode() || (herbLevel >= 1500 || (Math.random() * 1500 <= herbLevel))) { event.setCancelled(true); m.mcDropItem(loc, is); @@ -192,14 +163,18 @@ public class Herbalism public void run() { block.setType(Material.CROPS); //This replants the wheat at a certain stage in development based on Herbalism Skill - if (PP.getSkillLevel(SkillType.HERBALISM) >= 600) + if(!PP.getGreenTerraMode()) + { + if (PP.getSkillLevel(SkillType.HERBALISM) >= 600) + block.setData((byte) 0x4); + else if (PP.getSkillLevel(SkillType.HERBALISM) >= 400) + block.setData((byte) 0x3); + else if (PP.getSkillLevel(SkillType.HERBALISM) >= 200) + block.setData((byte) 0x2); + else + block.setData((byte) 0x1); + } else block.setData((byte) 0x4); - else if (PP.getSkillLevel(SkillType.HERBALISM) >= 400) - block.setData((byte) 0x3); - else if (PP.getSkillLevel(SkillType.HERBALISM) >= 200) - block.setData((byte) 0x2); - else - block.setData((byte) 0x1); } }, 1);