plotsquared update.

This commit is contained in:
Brianna O'Keefe 2019-01-01 15:10:36 -05:00
parent 090597e5dc
commit 0bb13e7b2d
2 changed files with 13 additions and 5 deletions

View File

@ -67,7 +67,7 @@
<dependency>
<groupId>com</groupId>
<artifactId>plotsquared</artifactId>
<version>LATEST</version>
<version>BREAKING</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -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());
}
}