mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
No point in canceling the event
And it actually fixes the double call (see previous commit)
This commit is contained in:
parent
9143051d9f
commit
77014b03ef
@ -257,32 +257,20 @@ public class Herbalism {
|
|||||||
if (chance > greenThumbMaxChance) chance = (float) greenThumbMaxChance;
|
if (chance > greenThumbMaxChance) chance = (float) greenThumbMaxChance;
|
||||||
|
|
||||||
if (hasSeeds && (profile.getAbilityMode(AbilityType.GREEN_TERRA) || chance > Misc.getRandom().nextInt(activationChance))) {
|
if (hasSeeds && (profile.getAbilityMode(AbilityType.GREEN_TERRA) || chance > Misc.getRandom().nextInt(activationChance))) {
|
||||||
event.setCancelled(true);
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CROPS:
|
case CROPS:
|
||||||
Misc.dropItem(location, new ItemStack(Material.WHEAT));
|
|
||||||
Misc.randomDropItems(location, new ItemStack(Material.SEEDS), 50, 3);
|
|
||||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||||
break;
|
break;
|
||||||
case COCOA:
|
case COCOA:
|
||||||
Misc.dropItems(location, new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()), 3);
|
|
||||||
inventory.removeItem(new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()));
|
inventory.removeItem(new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()));
|
||||||
break;
|
break;
|
||||||
case CARROT:
|
case CARROT:
|
||||||
Misc.dropItem(location, new ItemStack(Material.CARROT_ITEM));
|
|
||||||
Misc.randomDropItems(location, new ItemStack(Material.CARROT_ITEM), 50, 3);
|
|
||||||
inventory.removeItem(new ItemStack(Material.CARROT_ITEM));
|
inventory.removeItem(new ItemStack(Material.CARROT_ITEM));
|
||||||
break;
|
break;
|
||||||
case POTATO:
|
case POTATO:
|
||||||
Misc.dropItem(location, new ItemStack(Material.POTATO_ITEM));
|
|
||||||
Misc.randomDropItems(location, new ItemStack(Material.POTATO_ITEM), 50, 3);
|
|
||||||
Misc.randomDropItem(location, new ItemStack(Material.POISONOUS_POTATO), 2);
|
|
||||||
inventory.removeItem(new ItemStack(Material.POTATO_ITEM));
|
inventory.removeItem(new ItemStack(Material.POTATO_ITEM));
|
||||||
break;
|
break;
|
||||||
case NETHER_WARTS:
|
case NETHER_WARTS:
|
||||||
Misc.dropItems(location, new ItemStack(Material.NETHER_STALK), 2);
|
|
||||||
Misc.randomDropItems(location, new ItemStack(Material.NETHER_STALK), 50, 2);
|
|
||||||
inventory.removeItem(new ItemStack(Material.NETHER_STALK));
|
inventory.removeItem(new ItemStack(Material.NETHER_STALK));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user