ShopChest/de/epiceric/shopchest/event/ProtectChest.java
2015-09-02 13:06:48 +02:00

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());
}
}
}