2011-07-24 16:56:18 +02:00
|
|
|
package com.Acrobot.ChestShop.Listeners;
|
|
|
|
|
2012-04-07 12:41:20 +02:00
|
|
|
import com.Acrobot.ChestShop.Config.Config;
|
|
|
|
import com.Acrobot.ChestShop.Config.Property;
|
2011-07-24 16:56:18 +02:00
|
|
|
import org.bukkit.block.Block;
|
2012-02-16 19:09:37 +01:00
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.Listener;
|
2011-07-24 16:56:18 +02:00
|
|
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Acrobot
|
|
|
|
*/
|
2012-02-16 19:09:37 +01:00
|
|
|
public class entityExplode implements Listener {
|
2012-04-07 12:41:20 +02:00
|
|
|
@EventHandler(ignoreCancelled = true)
|
2012-02-16 19:09:37 +01:00
|
|
|
public static void onEntityExplode(EntityExplodeEvent event) {
|
2012-04-07 12:41:20 +02:00
|
|
|
if (event.blockList() == null || !Config.getBoolean(Property.USE_BUILT_IN_PROTECTION)) return;
|
2011-09-06 19:01:57 +02:00
|
|
|
for (Block block : event.blockList()) {
|
|
|
|
if (blockBreak.cancellingBlockBreak(block, null)) {
|
2011-07-24 16:56:18 +02:00
|
|
|
event.setCancelled(true);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|