mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-06 09:33:45 +01:00
Fix road interact on sponge
This commit is contained in:
parent
4d4950090d
commit
52496af9a1
@ -311,13 +311,13 @@ public class MainListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Location loc = SpongeUtil.getLocation(player.getWorld().getName(), target.get());
|
Location loc = SpongeUtil.getLocation(player.getWorld().getName(), target.get());
|
||||||
org.spongepowered.api.world.Location l = SpongeUtil.getLocation(loc);
|
PlotArea area = loc.getPlotArea();
|
||||||
Plot plot = loc.getPlot();
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot plot = area.getPlot(loc);
|
||||||
PlotPlayer pp = SpongeUtil.getPlayer(player);
|
PlotPlayer pp = SpongeUtil.getPlayer(player);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (loc.getPlotAbs() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_ROAD)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -336,6 +336,7 @@ public class MainListener {
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
com.google.common.base.Optional<HashSet<PlotBlock>> flag = plot.getFlag(Flags.USE);
|
com.google.common.base.Optional<HashSet<PlotBlock>> flag = plot.getFlag(Flags.USE);
|
||||||
|
org.spongepowered.api.world.Location l = SpongeUtil.getLocation(loc);
|
||||||
if (flag.isPresent() && flag.get().contains(SpongeUtil.getPlotBlock(l.getBlock()))) {
|
if (flag.isPresent() && flag.get().contains(SpongeUtil.getPlotBlock(l.getBlock()))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -511,11 +512,12 @@ public class MainListener {
|
|||||||
Transaction<BlockSnapshot> first = transactions.get(0);
|
Transaction<BlockSnapshot> first = transactions.get(0);
|
||||||
BlockSnapshot pos = first.getOriginal();
|
BlockSnapshot pos = first.getOriginal();
|
||||||
Location loc = SpongeUtil.getLocation(worldName, pos.getPosition());
|
Location loc = SpongeUtil.getLocation(worldName, pos.getPosition());
|
||||||
Plot plot = loc.getPlot();
|
PlotArea area = loc.getPlotArea();
|
||||||
|
if (area == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot plot = area.getPlot(loc);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
if (loc.getPlotAbs() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_ROAD)) {
|
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_ROAD)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user