mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
parent
ae77313007
commit
b1cf7d0348
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user