ShopChest/de/epiceric/shopchest/event/ProtectChest.java

23 lines
536 B
Java
Raw Normal View History

2015-09-02 11:06:48 +00:00
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());
}
}
}