mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
block ignite
This commit is contained in:
parent
ec754c39b7
commit
af04881965
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user