mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 17:23:42 +01:00 
			
		
		
		
	Fixed Green Thumb consuming 2 seeds instead of 1
This commit is contained in:
		| @@ -14,6 +14,7 @@ Version 1.3.06 | ||||
|  + Added API functions for admin & party chat | ||||
|  + Added Iron Grip skill to Unarmed which gives players an chance to keep from being disarmed. | ||||
|  + Added some new languages to the locale files. | ||||
|  = Fixed Green Thumb consuming 2 seeds instead of 1 | ||||
|  = Fixed exploit where you could teleport to yourself with PTP to prevent things like fall damage | ||||
|  = Fixed NPE error with Metrics on startup | ||||
|  = Fixed bug where Herbalism required double drops permission to give XP | ||||
|   | ||||
| @@ -35,7 +35,6 @@ public class Herbalism { | ||||
|     public static void greenTerra(Player player, Block block) { | ||||
|         PlayerInventory inventory = player.getInventory(); | ||||
|         boolean hasSeeds = inventory.contains(Material.SEEDS); | ||||
|         Material type = block.getType(); | ||||
|  | ||||
|         if (!hasSeeds) { | ||||
|             player.sendMessage("You need more seeds to spread Green Terra");  //TODO: Needs more locale. | ||||
| @@ -43,6 +42,13 @@ public class Herbalism { | ||||
|         else if (hasSeeds && !block.getType().equals(Material.WHEAT)) { | ||||
|             inventory.removeItem(new ItemStack(Material.SEEDS)); | ||||
|             player.updateInventory(); | ||||
|             greenTerraConvert(player, block); | ||||
|              | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     public static void greenTerraConvert(Player player, Block block) { | ||||
|         Material type = block.getType(); | ||||
|          | ||||
|         if (Misc.blockBreakSimulate(block, player, false)) { | ||||
|             if (Config.getInstance().getHerbalismGreenThumbSmoothbrickToMossy() && type.equals(Material.SMOOTH_BRICK)) { | ||||
| @@ -56,7 +62,6 @@ public class Herbalism { | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Check if a block can be made mossy. | ||||
| @@ -302,7 +307,7 @@ public class Herbalism { | ||||
|         player.setItemInHand(new ItemStack(Material.SEEDS, seeds - 1)); | ||||
|  | ||||
|         if (skillLevel > MAX_BONUS_LEVEL || random.nextInt(1500) <= skillLevel) { | ||||
|             greenTerra(player, block); | ||||
|             greenTerraConvert(player, block); | ||||
|         } | ||||
|         else { | ||||
|             player.sendMessage(LocaleLoader.getString("mcPlayerListener.GreenThumbFail")); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 nossr50
					nossr50