mirror of
https://github.com/craftaro/EpicSpawners.git
synced 2025-01-09 03:57:40 +08:00
plotsquared update.
This commit is contained in:
parent
090597e5dc
commit
0bb13e7b2d
@ -67,7 +67,7 @@
|
||||
<dependency>
|
||||
<groupId>com</groupId>
|
||||
<artifactId>plotsquared</artifactId>
|
||||
<version>LATEST</version>
|
||||
<version>BREAKING</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.songoda.epicspawners.hooks;
|
||||
|
||||
import com.intellectualcrafters.plot.api.PlotAPI;
|
||||
import com.plotsquared.bukkit.BukkitMain;
|
||||
import com.github.intellectualsites.plotsquared.api.PlotAPI;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.BukkitMain;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
|
||||
import com.songoda.epicspawners.api.utils.ProtectionPluginHook;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -22,8 +23,15 @@ public class HookPlotSquared implements ProtectionPluginHook {
|
||||
|
||||
@Override
|
||||
public boolean canBuild(Player player, Location location) {
|
||||
return plotSquared.getPlot(location) != null && plotSquared.isInPlot(player)
|
||||
&& plotSquared.getPlot(location) == plotSquared.getPlot(player);
|
||||
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
|
||||
new com.github.intellectualsites.plotsquared.plot.object.Location(location.getWorld().getName(),
|
||||
location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||
|
||||
PlotArea plotArea = plotSquared.getPlotSquared().getPlotAreaAbs(plotLocation);
|
||||
|
||||
return plotArea != null && plotArea.contains(plotLocation)
|
||||
&& plotArea.getPlot(plotLocation).getOwners().contains(player.getUniqueId())
|
||||
&& plotArea.getPlot(plotLocation).getMembers().contains(player.getUniqueId());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user