mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Fixes
Fix plot cluster command NPE Fix path iterator (for Plot.getAllCorners()) being off by 1
This commit is contained in:
parent
fb2e949711
commit
c8ddcd7f54
5 changed files with 30 additions and 57 deletions
|
@ -2046,6 +2046,7 @@ public class PS {
|
||||||
options.put("clear.auto.calibration.data_sd", 0);
|
options.put("clear.auto.calibration.data_sd", 0);
|
||||||
options.put("clear.auto.calibration.air_sd", 0);
|
options.put("clear.auto.calibration.air_sd", 0);
|
||||||
options.put("clear.auto.calibration.variety_sd", 0);
|
options.put("clear.auto.calibration.variety_sd", 0);
|
||||||
|
options.put("clear.auto.confirmation", Settings.AUTO_CLEAR_CONFIRMATION); // TODO FIXME
|
||||||
|
|
||||||
final int keep = config.getInt("clear.keep-if-modified");
|
final int keep = config.getInt("clear.keep-if-modified");
|
||||||
final int ignore = config.getInt("clear.ignore-if-modified");
|
final int ignore = config.getInt("clear.ignore-if-modified");
|
||||||
|
@ -2090,7 +2091,7 @@ public class PS {
|
||||||
|
|
||||||
// Teleportation
|
// Teleportation
|
||||||
options.put("teleport.on_login", Settings.TELEPORT_ON_LOGIN);
|
options.put("teleport.on_login", Settings.TELEPORT_ON_LOGIN);
|
||||||
options.put("teleport.delay", 0);
|
options.put("teleport.delay", Settings.TELEPORT_DELAY);
|
||||||
|
|
||||||
// WorldEdit
|
// WorldEdit
|
||||||
options.put("worldedit.require-selection-in-mask", Settings.REQUIRE_SELECTION);
|
options.put("worldedit.require-selection-in-mask", Settings.REQUIRE_SELECTION);
|
||||||
|
@ -2177,6 +2178,7 @@ public class PS {
|
||||||
PlotAnalysis.MODIFIERS.data_sd = config.getInt("clear.auto.calibration.data_sd");
|
PlotAnalysis.MODIFIERS.data_sd = config.getInt("clear.auto.calibration.data_sd");
|
||||||
PlotAnalysis.MODIFIERS.air_sd = config.getInt("clear.auto.calibration.air_sd");
|
PlotAnalysis.MODIFIERS.air_sd = config.getInt("clear.auto.calibration.air_sd");
|
||||||
PlotAnalysis.MODIFIERS.variety_sd = config.getInt("clear.auto.calibration.variety_sd");
|
PlotAnalysis.MODIFIERS.variety_sd = config.getInt("clear.auto.calibration.variety_sd");
|
||||||
|
Settings.AUTO_CLEAR_CONFIRMATION = config.getBoolean("clear.auto.confirmation"); // TODO FIXME
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
Settings.REQUIRE_DONE = config.getBoolean("approval.ratings.require-done");
|
Settings.REQUIRE_DONE = config.getBoolean("approval.ratings.require-done");
|
||||||
|
|
|
@ -20,29 +20,21 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
package com.intellectualcrafters.plot.commands;
|
package com.intellectualcrafters.plot.commands;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
import com.intellectualcrafters.plot.config.Settings;
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import com.intellectualcrafters.plot.flag.Flag;
|
import com.intellectualcrafters.plot.object.*;
|
||||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
|
||||||
import com.intellectualcrafters.plot.object.BlockLoc;
|
|
||||||
import com.intellectualcrafters.plot.object.Location;
|
|
||||||
import com.intellectualcrafters.plot.object.Plot;
|
|
||||||
import com.intellectualcrafters.plot.object.PlotArea;
|
|
||||||
import com.intellectualcrafters.plot.object.PlotCluster;
|
|
||||||
import com.intellectualcrafters.plot.object.PlotId;
|
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
import com.intellectualcrafters.plot.util.Permissions;
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@CommandDeclaration(
|
@CommandDeclaration(
|
||||||
command = "cluster",
|
command = "cluster",
|
||||||
aliases = { "clusters" },
|
aliases = { "clusters" },
|
||||||
|
@ -163,8 +155,6 @@ public class Cluster extends SubCommand {
|
||||||
// Add any existing plots to the current cluster
|
// Add any existing plots to the current cluster
|
||||||
for (final Plot plot : plots) {
|
for (final Plot plot : plots) {
|
||||||
if (plot.hasOwner()) {
|
if (plot.hasOwner()) {
|
||||||
final Flag flag = new Flag(FlagManager.getFlag("cluster"), cluster);
|
|
||||||
FlagManager.addPlotFlag(plot, flag);
|
|
||||||
if (!cluster.isAdded(plot.owner)) {
|
if (!cluster.isAdded(plot.owner)) {
|
||||||
cluster.invited.add(plot.owner);
|
cluster.invited.add(plot.owner);
|
||||||
DBFunc.setInvited(cluster, plot.owner);
|
DBFunc.setInvited(cluster, plot.owner);
|
||||||
|
@ -289,12 +279,6 @@ public class Cluster extends SubCommand {
|
||||||
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.cluster." + (current + cluster.getArea()));
|
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.cluster." + (current + cluster.getArea()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (final Plot plot : removed) {
|
|
||||||
FlagManager.removePlotFlag(plot, "cluster");
|
|
||||||
}
|
|
||||||
for (final Plot plot : newplots) {
|
|
||||||
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("cluster"), cluster));
|
|
||||||
}
|
|
||||||
// resize cluster
|
// resize cluster
|
||||||
DBFunc.resizeCluster(cluster, pos1, pos2);
|
DBFunc.resizeCluster(cluster, pos1, pos2);
|
||||||
MainUtil.sendMessage(plr, C.CLUSTER_RESIZED);
|
MainUtil.sendMessage(plr, C.CLUSTER_RESIZED);
|
||||||
|
|
|
@ -25,7 +25,9 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updater and DB settings
|
* Updater and DB settings
|
||||||
*
|
*
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class Settings {
|
public class Settings {
|
||||||
public static boolean USE_SQLUUIDHANDLER = false;
|
public static boolean USE_SQLUUIDHANDLER = false;
|
||||||
|
@ -156,11 +158,12 @@ public class Settings {
|
||||||
/**
|
/**
|
||||||
* The delay (in seconds) before teleportation commences
|
* The delay (in seconds) before teleportation commences
|
||||||
*/
|
*/
|
||||||
public static int TELEPORT_DELAY;
|
public static int TELEPORT_DELAY = 0;
|
||||||
/**
|
/**
|
||||||
* Auto clear enabled
|
* Auto clear enabled
|
||||||
*/
|
*/
|
||||||
public static boolean AUTO_CLEAR = false;
|
public static boolean AUTO_CLEAR = false;
|
||||||
|
public static boolean AUTO_CLEAR_CONFIRMATION = true; // TODO FIXME
|
||||||
/**
|
/**
|
||||||
* Days until a plot gets cleared
|
* Days until a plot gets cleared
|
||||||
*/
|
*/
|
||||||
|
@ -194,7 +197,8 @@ public class Settings {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database settings
|
* Database settings
|
||||||
*
|
*
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public static class DB {
|
public static class DB {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2998,7 +2998,6 @@ public class SQLManager implements AbstractDB {
|
||||||
if (!map.isEmpty()) {
|
if (!map.isEmpty()) {
|
||||||
for (final Entry<PlotId, Plot> entry2 : map.entrySet()) {
|
for (final Entry<PlotId, Plot> entry2 : map.entrySet()) {
|
||||||
Plot plot = entry2.getValue();
|
Plot plot = entry2.getValue();
|
||||||
System.out.println("Plot: " + plot + " | " + worldname);
|
|
||||||
PS.debug("$1Plot was deleted: " + entry2.getValue() + "// TODO implement this when sure safe");
|
PS.debug("$1Plot was deleted: " + entry2.getValue() + "// TODO implement this when sure safe");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,25 +20,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
package com.intellectualcrafters.plot.object;
|
package com.intellectualcrafters.plot.object;
|
||||||
|
|
||||||
import java.awt.Rectangle;
|
|
||||||
import java.awt.geom.Area;
|
|
||||||
import java.awt.geom.PathIterator;
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.ArrayDeque;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.BiMap;
|
||||||
import com.intellectualcrafters.jnbt.CompoundTag;
|
import com.intellectualcrafters.jnbt.CompoundTag;
|
||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
|
@ -48,18 +29,21 @@ import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import com.intellectualcrafters.plot.flag.Flag;
|
import com.intellectualcrafters.plot.flag.Flag;
|
||||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||||
import com.intellectualcrafters.plot.util.BO3Handler;
|
import com.intellectualcrafters.plot.util.*;
|
||||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
|
||||||
import com.intellectualcrafters.plot.util.EventUtil;
|
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
|
||||||
import com.intellectualcrafters.plot.util.Permissions;
|
|
||||||
import com.intellectualcrafters.plot.util.SchematicHandler;
|
|
||||||
import com.intellectualcrafters.plot.util.SetQueue;
|
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
|
||||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
|
||||||
import com.intellectualcrafters.plot.util.WorldUtil;
|
|
||||||
import com.plotsquared.listener.PlotListener;
|
import com.plotsquared.listener.PlotListener;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.geom.Area;
|
||||||
|
import java.awt.geom.PathIterator;
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The plot class
|
* The plot class
|
||||||
*/
|
*/
|
||||||
|
@ -2398,7 +2382,7 @@ public class Plot {
|
||||||
public List<Location> getAllCorners() {
|
public List<Location> getAllCorners() {
|
||||||
final Area area = new Area();
|
final Area area = new Area();
|
||||||
for (final RegionWrapper region : this.getRegions()) {
|
for (final RegionWrapper region : this.getRegions()) {
|
||||||
final Area rectArea = new Area(new Rectangle(region.minX, region.minZ, region.maxX - region.minX, region.maxZ - region.minZ));
|
final Area rectArea = new Area(new Rectangle(region.minX, region.minZ, region.maxX - region.minX + 1, region.maxZ - region.minZ + 1));
|
||||||
area.add(rectArea);
|
area.add(rectArea);
|
||||||
}
|
}
|
||||||
final List<Location> locs = new ArrayList<>();
|
final List<Location> locs = new ArrayList<>();
|
||||||
|
|
Loading…
Reference in a new issue