mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Minor adjustment to plot home location logic
- Allow "centre" spelling - ClassicPlotWorld contains the PLOT_HEIGHT config setting, not HPW
This commit is contained in:
parent
b97e843849
commit
3d4d413de8
@ -2099,6 +2099,7 @@ public class SQLManager implements AbstractDB {
|
||||
case "default":
|
||||
case "0,0,0":
|
||||
case "center":
|
||||
case "centre":
|
||||
break;
|
||||
default:
|
||||
try {
|
||||
@ -2946,6 +2947,7 @@ public class SQLManager implements AbstractDB {
|
||||
case "default":
|
||||
case "0,0,0":
|
||||
case "center":
|
||||
case "centre":
|
||||
break;
|
||||
default:
|
||||
try {
|
||||
|
@ -56,7 +56,7 @@ public final class PlotLoc {
|
||||
public static @Nullable PlotLoc fromString(final String input) {
|
||||
if (input == null || "side".equalsIgnoreCase(input)) {
|
||||
return null;
|
||||
} else if (StringMan.isEqualIgnoreCaseToAny(input, "center", "middle")) {
|
||||
} else if (StringMan.isEqualIgnoreCaseToAny(input, "center", "middle", "centre")) {
|
||||
return new PlotLoc(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
} else {
|
||||
try {
|
||||
|
@ -39,6 +39,7 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.database.DBFunc;
|
||||
import com.plotsquared.core.events.Result;
|
||||
import com.plotsquared.core.events.TeleportCause;
|
||||
import com.plotsquared.core.generator.ClassicPlotWorld;
|
||||
import com.plotsquared.core.generator.HybridPlotWorld;
|
||||
import com.plotsquared.core.listener.PlotListener;
|
||||
import com.plotsquared.core.location.BlockLoc;
|
||||
@ -1328,7 +1329,7 @@ public class Plot {
|
||||
return Location.at(
|
||||
"",
|
||||
0,
|
||||
this.getArea() instanceof HybridPlotWorld ? ((HybridPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
this.getArea() instanceof ClassicPlotWorld ? ((ClassicPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
0
|
||||
);
|
||||
}
|
||||
@ -1403,7 +1404,7 @@ public class Plot {
|
||||
return Location.at(
|
||||
"",
|
||||
0,
|
||||
this.getArea() instanceof HybridPlotWorld ? ((HybridPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
this.getArea() instanceof ClassicPlotWorld ? ((ClassicPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
0
|
||||
);
|
||||
}
|
||||
@ -1442,7 +1443,7 @@ public class Plot {
|
||||
result.accept(Location.at(
|
||||
"",
|
||||
0,
|
||||
this.getArea() instanceof HybridPlotWorld ? ((HybridPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
this.getArea() instanceof ClassicPlotWorld ? ((ClassicPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
0
|
||||
));
|
||||
return;
|
||||
@ -1539,7 +1540,7 @@ public class Plot {
|
||||
result.accept(Location.at(
|
||||
"",
|
||||
0,
|
||||
this.getArea() instanceof HybridPlotWorld ? ((HybridPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
this.getArea() instanceof ClassicPlotWorld ? ((ClassicPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 4,
|
||||
0
|
||||
));
|
||||
return;
|
||||
@ -1572,7 +1573,8 @@ public class Plot {
|
||||
y -> result.accept(Location.at(plot.getWorldName(), x, y + 1, z))
|
||||
);
|
||||
} else {
|
||||
result.accept(Location.at(plot.getWorldName(), x, 63, z, loc.getYaw(), loc.getPitch()));
|
||||
int y = this.getArea() instanceof ClassicPlotWorld ? ((ClassicPlotWorld) this.getArea()).PLOT_HEIGHT + 1 : 63;
|
||||
result.accept(Location.at(plot.getWorldName(), x, y, z, loc.getYaw(), loc.getPitch()));
|
||||
}
|
||||
} else {
|
||||
result.accept(Location.at(plot.getWorldName(), x, loc.getY(), z, loc.getYaw(), loc.getPitch()));
|
||||
|
@ -381,7 +381,7 @@ public abstract class PlotArea {
|
||||
|
||||
if ("side".equalsIgnoreCase(homeDefault)) {
|
||||
this.defaultHome = null;
|
||||
} else if (StringMan.isEqualIgnoreCaseToAny(homeDefault, "center", "middle")) {
|
||||
} else if (StringMan.isEqualIgnoreCaseToAny(homeDefault, "center", "middle", "centre")) {
|
||||
this.defaultHome = new BlockLoc(Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE);
|
||||
} else {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user