Add liquid-flow flag

This commit is contained in:
Jesse Boyd 2016-06-20 22:47:57 +10:00
parent a2ca9a52ea
commit 3fabfa10d7
2 changed files with 12 additions and 0 deletions

View File

@ -898,8 +898,19 @@ public class PlayerEvents extends PlotListener implements Listener {
if (plot != null) {
if (Flags.DISABLE_PHYSICS.isFalse(plot)) {
event.setCancelled(true);
return;
} else if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects.equals(plot, area.getOwnedPlot(fLocation))) {
event.setCancelled(true);
return;
}
if (Flags.LIQUID_FLOW.isFalse(plot)) {
switch (to.getType()) {
case WATER:
case STATIONARY_WATER:
case LAVA:
case STATIONARY_LAVA:
event.setCancelled(true);
}
}
} else if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects.equals(plot, area.getOwnedPlot(fLocation))) {
event.setCancelled(true);

View File

@ -47,6 +47,7 @@ public final class Flags {
public static final BooleanFlag VINE_GROW = new BooleanFlag("vine-grow");
public static final BooleanFlag MYCEL_GROW = new BooleanFlag("mycel-grow");
public static final BooleanFlag DISABLE_PHYSICS = new BooleanFlag("disable-physics");
public static final BooleanFlag LIQUID_FLOW = new BooleanFlag("liquid-flow");
public static final BooleanFlag SNOW_MELT = new BooleanFlag("snow-melt");
public static final BooleanFlag ICE_MELT = new BooleanFlag("ice-melt");
public static final BooleanFlag FIRE_SPREAD = new BooleanFlag("fire-spread");