mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Address comments
This commit is contained in:
parent
2f5e6665f7
commit
5226a0f4bc
@ -198,20 +198,20 @@ public class EntitySpawnListener implements Listener {
|
||||
final Location fromLocLocation = BukkitUtil.adapt(fromLocation.getLocation());
|
||||
final PlotArea fromArea = fromLocLocation.getPlotArea();
|
||||
Location toLocLocation = BukkitUtil.adapt(toLocation.getLocation());
|
||||
PlotArea area = toLocLocation.getPlotArea();
|
||||
PlotArea toArea = toLocLocation.getPlotArea();
|
||||
|
||||
if (area == null) {
|
||||
if (toArea == null) {
|
||||
if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlot(toLocLocation);
|
||||
Plot toPlot = toArea.getOwnedPlot(toLocLocation);
|
||||
if (fromLocation.getType() == EntityType.SHULKER && fromArea != null) {
|
||||
final Plot fromPlot = fromArea.getOwnedPlot(fromLocLocation);
|
||||
|
||||
if (fromPlot != null || plot != null) {
|
||||
if ((fromPlot == null || !fromPlot.equals(plot)) && (plot == null || !plot.equals(fromPlot))) {
|
||||
if (fromPlot != null || toPlot != null) {
|
||||
if ((fromPlot == null || !fromPlot.equals(toPlot)) && (toPlot == null || !toPlot.equals(fromPlot))) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user