mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Fix INSTABREAK flag
This commit is contained in:
parent
237a0d8b6b
commit
f1f6b2781e
@ -8,13 +8,19 @@ import com.plotsquared.bukkit.events.PlayerEnterPlotEvent;
|
|||||||
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
|
import com.plotsquared.bukkit.events.PlayerLeavePlotEvent;
|
||||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||||
import com.plotsquared.listener.PlotListener;
|
import com.plotsquared.listener.PlotListener;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.UUID;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockDamageEvent;
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||||
@ -22,11 +28,6 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class PlotPlusListener extends PlotListener implements Listener {
|
public class PlotPlusListener extends PlotListener implements Listener {
|
||||||
|
|
||||||
private static final HashMap<String, Interval> feedRunnable = new HashMap<>();
|
private static final HashMap<String, Interval> feedRunnable = new HashMap<>();
|
||||||
@ -89,9 +90,14 @@ public class PlotPlusListener extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Flags.INSTABREAK.isTrue(plot)) {
|
if (Flags.INSTABREAK.isTrue(plot)) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
BlockBreakEvent call = new BlockBreakEvent(block, player);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(call);
|
||||||
|
if (!call.isCancelled()) {
|
||||||
event.getBlock().breakNaturally();
|
event.getBlock().breakNaturally();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onDamage(EntityDamageEvent event) {
|
public void onDamage(EntityDamageEvent event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user