mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Add snow-form flag
This commit is contained in:
parent
177b33154f
commit
b6df07f723
@ -73,6 +73,7 @@ import org.bukkit.event.block.BlockBurnEvent;
|
|||||||
import org.bukkit.event.block.BlockDamageEvent;
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
import org.bukkit.event.block.BlockDispenseEvent;
|
import org.bukkit.event.block.BlockDispenseEvent;
|
||||||
import org.bukkit.event.block.BlockFadeEvent;
|
import org.bukkit.event.block.BlockFadeEvent;
|
||||||
|
import org.bukkit.event.block.BlockFormEvent;
|
||||||
import org.bukkit.event.block.BlockFromToEvent;
|
import org.bukkit.event.block.BlockFromToEvent;
|
||||||
import org.bukkit.event.block.BlockGrowEvent;
|
import org.bukkit.event.block.BlockGrowEvent;
|
||||||
import org.bukkit.event.block.BlockIgniteEvent;
|
import org.bukkit.event.block.BlockIgniteEvent;
|
||||||
@ -833,6 +834,27 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
public void onBlockSpread(BlockFormEvent event) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||||
|
if (location.isPlotRoad()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PlotArea area = location.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot plot = area.getOwnedPlot(location);
|
||||||
|
if (plot == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Flags.SNOW_FORM.isFalse(plot)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockDamage(BlockDamageEvent event) {
|
public void onBlockDamage(BlockDamageEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
@ -50,6 +50,7 @@ public final class Flags {
|
|||||||
public static final BooleanFlag DISABLE_PHYSICS = new BooleanFlag("disable-physics");
|
public static final BooleanFlag DISABLE_PHYSICS = new BooleanFlag("disable-physics");
|
||||||
public static final BooleanFlag LIQUID_FLOW = new BooleanFlag("liquid-flow");
|
public static final BooleanFlag LIQUID_FLOW = new BooleanFlag("liquid-flow");
|
||||||
public static final BooleanFlag SNOW_MELT = new BooleanFlag("snow-melt");
|
public static final BooleanFlag SNOW_MELT = new BooleanFlag("snow-melt");
|
||||||
|
public static final BooleanFlag SNOW_FORM = new BooleanFlag("snow-form");
|
||||||
public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt");
|
public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt");
|
||||||
public static final BooleanFlag FIRE_SPREAD = new BooleanFlag("fire-spread");
|
public static final BooleanFlag FIRE_SPREAD = new BooleanFlag("fire-spread");
|
||||||
public static final BooleanFlag BLOCK_BURN = new BooleanFlag("block-burn");
|
public static final BooleanFlag BLOCK_BURN = new BooleanFlag("block-burn");
|
||||||
|
Loading…
Reference in New Issue
Block a user