mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Cleanup Code
I also updated the build.gradle and pom to 1.9 bukkit
This commit is contained in:
@ -246,7 +246,7 @@ public class ConfigurationSerialization {
|
||||
|
||||
final SerializableAs alias = clazz.getAnnotation(SerializableAs.class);
|
||||
|
||||
if ((alias != null) && (alias.value() != null)) {
|
||||
if (alias != null) {
|
||||
return alias.value();
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,6 @@ public class Claim extends SubCommand {
|
||||
return sendMessage(plr, C.NOT_IN_PLOT);
|
||||
}
|
||||
final int currentPlots = Settings.GLOBAL_LIMIT ? plr.getPlotCount() : plr.getPlotCount(loc.getWorld());
|
||||
boolean removeGrantedPlot = false;
|
||||
int grants = 0;
|
||||
if (currentPlots >= plr.getAllowedPlots()) {
|
||||
if (plr.hasPersistentMeta("grantedPlots")) {
|
||||
|
@ -65,10 +65,6 @@ public class Condense extends SubCommand {
|
||||
MainUtil.sendMessage(plr, "TASK ALREADY STARTED");
|
||||
return false;
|
||||
}
|
||||
if (args.length == 2) {
|
||||
MainUtil.sendMessage(plr, "/plot condense " + area.toString() + " start <radius>");
|
||||
return false;
|
||||
}
|
||||
if (!MathMan.isInteger(args[2])) {
|
||||
MainUtil.sendMessage(plr, "INVALID RADIUS");
|
||||
return false;
|
||||
|
@ -12,6 +12,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@CommandDeclaration(
|
||||
command = "debugpaste",
|
||||
@ -41,7 +42,7 @@ public class DebugPaste extends SubCommand {
|
||||
b.append("links.settings_yml: '").append(settingsYML).append("'\n");
|
||||
b.append("links.latest_log: '").append(latestLOG).append("'\n");
|
||||
b.append("\n# YAAAS! Now let us move on to the server info\n");
|
||||
b.append("version.server: '").append(PS.get().IMP.getServerVersion()).append("'\n");
|
||||
b.append("version.server: '").append(Arrays.toString(PS.get().IMP.getServerVersion())).append("'\n");
|
||||
b.append("online_mode: ").append(UUIDHandler.getUUIDWrapper() + ";" + !Settings.OFFLINE_MODE).append("\n");
|
||||
b.append("plugins:");
|
||||
for (String id : PS.get().IMP.getPluginIds()) {
|
||||
|
@ -464,20 +464,14 @@ public class SQLManager implements AbstractDB {
|
||||
final Plot plot = plotMap.get(plotId);
|
||||
if (plot != null) {
|
||||
settings.add(new SettingsPair(id, plot.getSettings()));
|
||||
if (plot.getDenied() != null) {
|
||||
for (final UUID uuid : plot.getDenied()) {
|
||||
denied.add(new UUIDPair(id, uuid));
|
||||
}
|
||||
for (final UUID uuid : plot.getDenied()) {
|
||||
denied.add(new UUIDPair(id, uuid));
|
||||
}
|
||||
if (plot.getMembers() != null) {
|
||||
for (final UUID uuid : plot.getMembers()) {
|
||||
trusted.add(new UUIDPair(id, uuid));
|
||||
}
|
||||
for (final UUID uuid : plot.getMembers()) {
|
||||
trusted.add(new UUIDPair(id, uuid));
|
||||
}
|
||||
if (plot.getTrusted() != null) {
|
||||
for (final UUID uuid : plot.getTrusted()) {
|
||||
helpers.add(new UUIDPair(id, uuid));
|
||||
}
|
||||
for (final UUID uuid : plot.getTrusted()) {
|
||||
helpers.add(new UUIDPair(id, uuid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -203,9 +203,6 @@ public class Location implements Cloneable, Comparable<Location> {
|
||||
|
||||
@Override
|
||||
public int compareTo(final Location o) {
|
||||
if (o == null) {
|
||||
throw new NullPointerException("Specified object was null");
|
||||
}
|
||||
if (x == o.getX() && y == o.getY() || z == o.getZ()) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ public class Plot {
|
||||
*/
|
||||
public HashSet<UUID> getOwners() {
|
||||
if (owner == null) {
|
||||
return new HashSet<UUID>();
|
||||
return new HashSet<>();
|
||||
}
|
||||
if (isMerged()) {
|
||||
HashSet<Plot> plots = getConnectedPlots();
|
||||
@ -910,16 +910,15 @@ public class Plot {
|
||||
});
|
||||
return;
|
||||
}
|
||||
final String rename = name == null ? "unknown" : name;
|
||||
final PlotManager manager = this.area.getPlotManager();
|
||||
if (this.area.ALLOW_SIGNS) {
|
||||
final Location loc = manager.getSignLoc(this.area, this);
|
||||
final String id = this.id.x + ";" + this.id.y;
|
||||
final String[] lines = new String[] {
|
||||
C.OWNER_SIGN_LINE_1.formatted().replaceAll("%id%", id),
|
||||
C.OWNER_SIGN_LINE_2.formatted().replaceAll("%id%", id).replaceAll("%plr%", rename),
|
||||
C.OWNER_SIGN_LINE_3.formatted().replaceAll("%id%", id).replaceAll("%plr%", rename),
|
||||
C.OWNER_SIGN_LINE_4.formatted().replaceAll("%id%", id).replaceAll("%plr%", rename) };
|
||||
C.OWNER_SIGN_LINE_2.formatted().replaceAll("%id%", id).replaceAll("%plr%", name),
|
||||
C.OWNER_SIGN_LINE_3.formatted().replaceAll("%id%", id).replaceAll("%plr%", name),
|
||||
C.OWNER_SIGN_LINE_4.formatted().replaceAll("%id%", id).replaceAll("%plr%", name) };
|
||||
WorldUtil.IMP.setSign(this.area.worldname, loc.getX(), loc.getY(), loc.getZ(), lines);
|
||||
}
|
||||
}
|
||||
@ -1242,7 +1241,7 @@ public class Plot {
|
||||
*/
|
||||
public void setSign() {
|
||||
if (this.owner == null) {
|
||||
this.setSign(null);
|
||||
this.setSign("unknown");
|
||||
return;
|
||||
}
|
||||
this.setSign(UUIDHandler.getName(this.owner));
|
||||
|
Reference in New Issue
Block a user