mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 11:55:38 +01:00
Fixes #1784
This commit is contained in:
parent
98b7a84119
commit
9f9527d2e2
@ -927,13 +927,15 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPeskyMobsChangeTheWorldLikeWTFEvent(EntityChangeBlockEvent event) {
|
||||
String world = event.getBlock().getWorld().getName();
|
||||
if (!PS.get().hasPlotArea(world)) {
|
||||
return;
|
||||
}
|
||||
Entity e = event.getEntity();
|
||||
if (!(e instanceof FallingBlock)) {
|
||||
event.setCancelled(true);
|
||||
Location location = BukkitUtil.getLocation(event.getBlock().getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area != null) {
|
||||
Plot plot = area.getOwnedPlot(location);
|
||||
if (plot != null && Flags.MOB_BREAK.isTrue(plot)) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,7 @@ public final class Flags {
|
||||
public static final BooleanFlag HOSTILE_ATTACK = new BooleanFlag("hostile-attack");
|
||||
public static final BooleanFlag HOSTILE_INTERACT = new BooleanFlag("hostile-interact");
|
||||
public static final BooleanFlag MOB_PLACE = new BooleanFlag("mob-place");
|
||||
public static final BooleanFlag MOB_BREAK = new BooleanFlag("mob-break");
|
||||
public static final BooleanFlag FORCEFIELD = new BooleanFlag("forcefield");
|
||||
public static final BooleanFlag INVINCIBLE = new BooleanFlag("invincible");
|
||||
public static final BooleanFlag ITEM_DROP = new BooleanFlag("item-drop");
|
||||
|
Loading…
Reference in New Issue
Block a user