mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Fixed Green Thumb consuming 2 seeds instead of 1
This commit is contained in:
parent
4840b435f5
commit
859d4f5372
@ -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,17 +42,23 @@ public class Herbalism {
|
||||
else if (hasSeeds && !block.getType().equals(Material.WHEAT)) {
|
||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||
player.updateInventory();
|
||||
|
||||
if (Misc.blockBreakSimulate(block, player, false)) {
|
||||
if (Config.getInstance().getHerbalismGreenThumbSmoothbrickToMossy() && type.equals(Material.SMOOTH_BRICK)) {
|
||||
block.setData((byte) 0x1); //Set type of the brick to mossy
|
||||
}
|
||||
else if (Config.getInstance().getHerbalismGreenThumbDirtToGrass() && type.equals(Material.DIRT)) {
|
||||
block.setType(Material.GRASS);
|
||||
}
|
||||
else if (Config.getInstance().getHerbalismGreenThumbCobbleToMossy() && type.equals(Material.COBBLESTONE)) {
|
||||
block.setType(Material.MOSSY_COBBLESTONE);
|
||||
}
|
||||
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)) {
|
||||
block.setData((byte) 0x1); //Set type of the brick to mossy
|
||||
}
|
||||
else if (Config.getInstance().getHerbalismGreenThumbDirtToGrass() && type.equals(Material.DIRT)) {
|
||||
block.setType(Material.GRASS);
|
||||
}
|
||||
else if (Config.getInstance().getHerbalismGreenThumbCobbleToMossy() && type.equals(Material.COBBLESTONE)) {
|
||||
block.setType(Material.MOSSY_COBBLESTONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user