mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
Don't return the "side" for world plots when accessing default home locations
This commit is contained in:
parent
a7026047d0
commit
1f26808c7b
@ -40,7 +40,6 @@ import com.plotsquared.core.database.DBFunc;
|
|||||||
import com.plotsquared.core.events.Result;
|
import com.plotsquared.core.events.Result;
|
||||||
import com.plotsquared.core.events.TeleportCause;
|
import com.plotsquared.core.events.TeleportCause;
|
||||||
import com.plotsquared.core.generator.ClassicPlotWorld;
|
import com.plotsquared.core.generator.ClassicPlotWorld;
|
||||||
import com.plotsquared.core.generator.HybridPlotWorld;
|
|
||||||
import com.plotsquared.core.listener.PlotListener;
|
import com.plotsquared.core.listener.PlotListener;
|
||||||
import com.plotsquared.core.location.BlockLoc;
|
import com.plotsquared.core.location.BlockLoc;
|
||||||
import com.plotsquared.core.location.Direction;
|
import com.plotsquared.core.location.Direction;
|
||||||
@ -59,6 +58,7 @@ import com.plotsquared.core.plot.flag.implementations.KeepFlag;
|
|||||||
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
||||||
import com.plotsquared.core.plot.flag.types.DoubleFlag;
|
import com.plotsquared.core.plot.flag.types.DoubleFlag;
|
||||||
import com.plotsquared.core.plot.schematic.Schematic;
|
import com.plotsquared.core.plot.schematic.Schematic;
|
||||||
|
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||||
import com.plotsquared.core.queue.QueueCoordinator;
|
import com.plotsquared.core.queue.QueueCoordinator;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
@ -1512,6 +1512,12 @@ public class Plot {
|
|||||||
int z;
|
int z;
|
||||||
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
|
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
|
||||||
// center
|
// center
|
||||||
|
if (getArea() instanceof SinglePlotArea) {
|
||||||
|
int y = loc.getY() == Integer.MIN_VALUE
|
||||||
|
? (isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63)
|
||||||
|
: loc.getY();
|
||||||
|
return Location.at(plot.getWorldName(), 0, y, 0, 0, 0);
|
||||||
|
}
|
||||||
CuboidRegion largest = plot.getLargestRegion();
|
CuboidRegion largest = plot.getLargestRegion();
|
||||||
x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest
|
x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest
|
||||||
.getMinimumPoint()
|
.getMinimumPoint()
|
||||||
@ -1530,6 +1536,10 @@ public class Plot {
|
|||||||
: loc.getY();
|
: loc.getY();
|
||||||
return Location.at(plot.getWorldName(), x, y, z, loc.getYaw(), loc.getPitch());
|
return Location.at(plot.getWorldName(), x, y, z, loc.getYaw(), loc.getPitch());
|
||||||
}
|
}
|
||||||
|
if (getArea() instanceof SinglePlotArea) {
|
||||||
|
int y = isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63;
|
||||||
|
return Location.at(plot.getWorldName(), 0, y, 0, 0, 0);
|
||||||
|
}
|
||||||
// Side
|
// Side
|
||||||
return plot.getSideSynchronous();
|
return plot.getSideSynchronous();
|
||||||
}
|
}
|
||||||
@ -1551,6 +1561,10 @@ public class Plot {
|
|||||||
int z;
|
int z;
|
||||||
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
|
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
|
||||||
// center
|
// center
|
||||||
|
if (getArea() instanceof SinglePlotArea) {
|
||||||
|
x = 0;
|
||||||
|
z = 0;
|
||||||
|
} else {
|
||||||
CuboidRegion largest = plot.getLargestRegion();
|
CuboidRegion largest = plot.getLargestRegion();
|
||||||
x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest
|
x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest
|
||||||
.getMinimumPoint()
|
.getMinimumPoint()
|
||||||
@ -1558,6 +1572,7 @@ public class Plot {
|
|||||||
z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest
|
z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest
|
||||||
.getMinimumPoint()
|
.getMinimumPoint()
|
||||||
.getZ();
|
.getZ();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// specific
|
// specific
|
||||||
Location bot = plot.getBottomAbs();
|
Location bot = plot.getBottomAbs();
|
||||||
@ -1582,6 +1597,10 @@ public class Plot {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Side
|
// Side
|
||||||
|
if (getArea() instanceof SinglePlotArea) {
|
||||||
|
int y = isLoaded() ? this.worldUtil.getHighestBlockSynchronous(plot.getWorldName(), 0, 0) + 1 : 63;
|
||||||
|
result.accept(Location.at(plot.getWorldName(), 0, y, 0, 0, 0));
|
||||||
|
}
|
||||||
plot.getSide(result);
|
plot.getSide(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user