From af04881965ac2f2a3af8b6ab20dd5035006d8e4a Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 10 Nov 2014 18:28:29 +1100 Subject: [PATCH] block ignite --- .../plot/listeners/PlayerEvents.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 06455c531..5ea0478e2 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -418,6 +418,24 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public static void onBlockIgnite(final BlockIgniteEvent e) { + final World world; + + if (e.getBlock() != null) { + world = e.getBlock().getWorld(); + } + else if (e.getIgnitingEntity() != null) { + world = e.getIgnitingEntity().getWorld(); + } + else if (e.getPlayer() != null) { + world = e.getPlayer().getWorld(); + } + else { + return; + } + + if (!isPlotWorld(world)) { + return; + } if (e.getCause() == BlockIgniteEvent.IgniteCause.LIGHTNING) { e.setCancelled(true); return;