mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 18:32:24 +00:00
23 lines
536 B
Java
23 lines
536 B
Java
package de.epiceric.shopchest.event;
|
|
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.block.BlockBreakEvent;
|
|
|
|
import de.epiceric.shopchest.config.Config;
|
|
import de.epiceric.shopchest.utils.ShopUtils;
|
|
|
|
public class ProtectChest implements Listener {
|
|
|
|
public ProtectChest() {}
|
|
|
|
@EventHandler
|
|
public void onBlockBreak(BlockBreakEvent e) {
|
|
if (ShopUtils.isShop(e.getBlock().getLocation())) {
|
|
e.setCancelled(true);
|
|
e.getPlayer().sendMessage(Config.cannot_break_shop());
|
|
}
|
|
}
|
|
|
|
}
|