Fire FakeBlockBreakEvent when using Hylian Luck

Fixes #1528
This commit is contained in:
TfT_02 2013-10-11 23:47:42 +02:00
parent ae77313007
commit b1cf7d0348

View File

@ -16,6 +16,7 @@ import org.bukkit.material.CocoaPlant.CocoaPlantSize;
import org.bukkit.material.Crops; import org.bukkit.material.Crops;
import org.bukkit.material.NetherWarts; import org.bukkit.material.NetherWarts;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
@ -232,6 +233,13 @@ public class HerbalismManager extends SkillManager {
return false; return false;
} }
FakeBlockBreakEvent blockBreakEvent = new FakeBlockBreakEvent(blockState.getBlock(), getPlayer());
mcMMO.p.getServer().getPluginManager().callEvent(blockBreakEvent);
if (blockBreakEvent.isCancelled()) {
return false;
}
blockState.setType(Material.AIR); blockState.setType(Material.AIR);
Misc.dropItem(blockState.getLocation(), treasures.get(Misc.getRandom().nextInt(treasures.size())).getDrop()); Misc.dropItem(blockState.getLocation(), treasures.get(Misc.getRandom().nextInt(treasures.size())).getDrop());