Made priming TNT by punching it with flint and steel throw a block break blacklist event.

This commit is contained in:
Wizjany 2011-08-27 16:00:42 -04:00
parent b938271b4d
commit 6b9a3aff58

View File

@ -54,6 +54,7 @@
import com.sk89q.worldedit.Vector;
import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.blacklist.events.BlockBreakBlacklistEvent;
import com.sk89q.worldguard.blacklist.events.BlockInteractBlacklistEvent;
import com.sk89q.worldguard.blacklist.events.ItemAcquireBlacklistEvent;
import com.sk89q.worldguard.blacklist.events.ItemDropBlacklistEvent;
@ -452,6 +453,18 @@ private void handleBlockLeftClick(PlayerInteractEvent event) {
}
}
if (type == Material.TNT && player.getItemInHand().getType() == Material.FLINT_AND_STEEL) {
if (wcfg.getBlacklist() != null) {
if (!wcfg.getBlacklist().check(
new BlockBreakBlacklistEvent(plugin.wrapPlayer(player),
toVector(event.getClickedBlock()),
event.getClickedBlock().getTypeId()), false, false)) {
event.setCancelled(true);
return;
}
}
}
}
/**