mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-02 08:50:17 +01:00
Fixes #1784
This commit is contained in:
parent
98b7a84119
commit
9f9527d2e2
@ -927,15 +927,17 @@ 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)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEntityBlockForm(EntityBlockFormEvent event) {
|
||||
|
@ -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