26 lines
903 B
Java
26 lines
903 B
Java
package net.t2code.t2callayduplicate.Hooks;
|
|
|
|
import com.plotsquared.bukkit.player.BukkitPlayer;
|
|
import com.plotsquared.bukkit.util.BukkitUtil;
|
|
import com.plotsquared.core.PlotAPI;
|
|
import com.plotsquared.core.listener.PlayerBlockEventType;
|
|
import com.plotsquared.core.location.Location;
|
|
import com.plotsquared.core.util.EventDispatcher;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public class PlotSquaredIntegration {
|
|
private final EventDispatcher eventDispatcher = new PlotAPI().getPlotSquared().getEventDispatcher();
|
|
|
|
public PlotSquaredIntegration(){
|
|
}
|
|
|
|
public boolean isProtected(Player player, PlayerBlockEventType type){
|
|
BukkitPlayer pp = BukkitUtil.adapt(player);
|
|
Location location = BukkitUtil.adapt(player.getLocation());
|
|
if (!eventDispatcher.checkPlayerBlockEvent(pp, type, location, null, true)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|