mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Fix home command reset (#4295)
* Add location not null check The issue lies within the equals implementation * Fix setposition method with default value. Also add a comment too. --------- Co-authored-by: OneLiteFeather <seelenretterin@onelitefeather.net>
This commit is contained in:
parent
6371cd4c5a
commit
a1d94af242
@ -2401,7 +2401,8 @@ public class SQLManager implements AbstractDB {
|
|||||||
addPlotTask(plot, new UniqueStatement("setPosition") {
|
addPlotTask(plot, new UniqueStatement("setPosition") {
|
||||||
@Override
|
@Override
|
||||||
public void set(PreparedStatement statement) throws SQLException {
|
public void set(PreparedStatement statement) throws SQLException {
|
||||||
statement.setString(1, position == null ? "" : position);
|
// Please see the table creation statement. There is the default value of "default"
|
||||||
|
statement.setString(1, position == null ? "DEFAULT" : position);
|
||||||
statement.setInt(2, getId(plot));
|
statement.setInt(2, getId(plot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1483,7 +1483,7 @@ public class Plot {
|
|||||||
*/
|
*/
|
||||||
public void setHome(BlockLoc location) {
|
public void setHome(BlockLoc location) {
|
||||||
Plot plot = this.getBasePlot(false);
|
Plot plot = this.getBasePlot(false);
|
||||||
if (BlockLoc.ZERO.equals(location) || BlockLoc.MINY.equals(location)) {
|
if (location != null && (BlockLoc.ZERO.equals(location) || BlockLoc.MINY.equals(location))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
plot.getSettings().setPosition(location);
|
plot.getSettings().setPosition(location);
|
||||||
|
Loading…
Reference in New Issue
Block a user