mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Delombok + import organisation
This commit is contained in:
@ -37,7 +37,6 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.SchematicHandler;
|
||||
import com.plotsquared.core.util.query.PlotQuery;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
@ -57,7 +56,10 @@ import java.util.UUID;
|
||||
*
|
||||
* @version 5
|
||||
*/
|
||||
@SuppressWarnings({"unused", "WeakerAccess"}) @NoArgsConstructor public class PlotAPI {
|
||||
@SuppressWarnings({"unused", "WeakerAccess"}) public class PlotAPI {
|
||||
|
||||
public PlotAPI() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all plots.
|
||||
|
@ -25,11 +25,6 @@
|
||||
*/
|
||||
package com.plotsquared.core;
|
||||
|
||||
import com.plotsquared.core.command.WE_Anywhere;
|
||||
import com.plotsquared.core.components.ComponentPresetManager;
|
||||
import com.plotsquared.core.configuration.Caption;
|
||||
import com.plotsquared.core.configuration.caption.CaptionMap;
|
||||
import com.plotsquared.core.configuration.CaptionUtility;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
import com.plotsquared.core.configuration.ConfigurationUtil;
|
||||
@ -37,6 +32,7 @@ import com.plotsquared.core.configuration.MemorySection;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.Storage;
|
||||
import com.plotsquared.core.configuration.caption.CaptionLoader;
|
||||
import com.plotsquared.core.configuration.caption.CaptionMap;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.configuration.serialization.ConfigurationSerialization;
|
||||
import com.plotsquared.core.database.DBFunc;
|
||||
@ -64,20 +60,17 @@ import com.plotsquared.core.plot.expiration.ExpiryTask;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.util.ChunkManager;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.LegacyConverter;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.plotsquared.core.util.ReflectionUtils;
|
||||
import com.plotsquared.core.util.logger.ILogger;
|
||||
import com.plotsquared.core.util.query.PlotQuery;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import com.plotsquared.core.uuid.UUIDPipeline;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import lombok.Getter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -133,32 +126,32 @@ public class PlotSquared {
|
||||
// Current thread
|
||||
private final Thread thread;
|
||||
// UUID pipelines
|
||||
@Getter private final UUIDPipeline impromptuUUIDPipeline =
|
||||
private final UUIDPipeline impromptuUUIDPipeline =
|
||||
new UUIDPipeline(Executors.newCachedThreadPool());
|
||||
@Getter private final UUIDPipeline backgroundUUIDPipeline =
|
||||
private final UUIDPipeline backgroundUUIDPipeline =
|
||||
new UUIDPipeline(Executors.newSingleThreadExecutor());
|
||||
// WorldEdit instance
|
||||
@Getter private WorldEdit worldedit;
|
||||
@Getter private File configFile;
|
||||
@Getter private File worldsFile;
|
||||
private WorldEdit worldedit;
|
||||
private File configFile;
|
||||
private File worldsFile;
|
||||
public File translationFile; // TODO: REMOVE
|
||||
public YamlConfiguration style; // TODO: REMOVE
|
||||
@Getter private YamlConfiguration worldConfiguration;
|
||||
private YamlConfiguration worldConfiguration;
|
||||
// Temporary hold the plots/clusters before the worlds load
|
||||
private HashMap<String, Set<PlotCluster>> clustersTmp;
|
||||
public HashMap<String, HashMap<PlotId, Plot>> plots_tmp;
|
||||
private YamlConfiguration config;
|
||||
// Localization
|
||||
@Getter private CaptionMap captionMap;
|
||||
private CaptionMap captionMap;
|
||||
// Implementation logger
|
||||
@Setter @Getter private ILogger logger;
|
||||
private ILogger logger;
|
||||
// Platform / Version / Update URL
|
||||
private PlotVersion version;
|
||||
// Files and configuration
|
||||
@Getter private File jarFile = null; // This file
|
||||
private File jarFile = null; // This file
|
||||
private File storageFile;
|
||||
@Getter private EventDispatcher eventDispatcher;
|
||||
@Getter private PlotListener plotListener;
|
||||
private EventDispatcher eventDispatcher;
|
||||
private PlotListener plotListener;
|
||||
|
||||
/**
|
||||
* Initialize PlotSquared with the desired Implementation class.
|
||||
@ -1454,6 +1447,54 @@ public class PlotSquared {
|
||||
return config;
|
||||
}
|
||||
|
||||
public UUIDPipeline getImpromptuUUIDPipeline() {
|
||||
return this.impromptuUUIDPipeline;
|
||||
}
|
||||
|
||||
public UUIDPipeline getBackgroundUUIDPipeline() {
|
||||
return this.backgroundUUIDPipeline;
|
||||
}
|
||||
|
||||
public WorldEdit getWorldedit() {
|
||||
return this.worldedit;
|
||||
}
|
||||
|
||||
public File getConfigFile() {
|
||||
return this.configFile;
|
||||
}
|
||||
|
||||
public File getWorldsFile() {
|
||||
return this.worldsFile;
|
||||
}
|
||||
|
||||
public YamlConfiguration getWorldConfiguration() {
|
||||
return this.worldConfiguration;
|
||||
}
|
||||
|
||||
public CaptionMap getCaptionMap() {
|
||||
return this.captionMap;
|
||||
}
|
||||
|
||||
public ILogger getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
public File getJarFile() {
|
||||
return this.jarFile;
|
||||
}
|
||||
|
||||
public EventDispatcher getEventDispatcher() {
|
||||
return this.eventDispatcher;
|
||||
}
|
||||
|
||||
public PlotListener getPlotListener() {
|
||||
return this.plotListener;
|
||||
}
|
||||
|
||||
public void setLogger(ILogger logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public enum SortType {
|
||||
CREATION_DATE, CREATION_DATE_TIMESTAMP, LAST_MODIFIED, DISTANCE_FROM_ORIGIN
|
||||
}
|
||||
|
@ -25,11 +25,7 @@
|
||||
*/
|
||||
package com.plotsquared.core.backup;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
@ -38,12 +34,18 @@ import java.nio.file.Path;
|
||||
* Object representing a plot backup. This does not actually contain the
|
||||
* backup itself, it is just a pointer to an available backup
|
||||
*/
|
||||
@RequiredArgsConstructor(access = AccessLevel.PACKAGE) @Getter public class Backup {
|
||||
public class Backup {
|
||||
|
||||
private final BackupProfile owner;
|
||||
private final long creationTime;
|
||||
@Nullable private final Path file;
|
||||
|
||||
Backup(final BackupProfile owner, final long creationTime, final Path file) {
|
||||
this.owner = owner;
|
||||
this.creationTime = creationTime;
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the backup
|
||||
*/
|
||||
@ -57,4 +59,15 @@ import java.nio.file.Path;
|
||||
}
|
||||
}
|
||||
|
||||
public BackupProfile getOwner() {
|
||||
return this.owner;
|
||||
}
|
||||
|
||||
public long getCreationTime() {
|
||||
return this.creationTime;
|
||||
}
|
||||
|
||||
@Nullable public Path getFile() {
|
||||
return this.file;
|
||||
}
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ package com.plotsquared.core.backup;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.core.backup;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -29,9 +29,9 @@ import com.google.inject.Singleton;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.core.backup;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
@ -33,8 +33,8 @@ import com.plotsquared.core.plot.schematic.Schematic;
|
||||
import com.plotsquared.core.util.SchematicHandler;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
@ -36,12 +36,9 @@ import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
@ -51,11 +48,11 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@RequiredArgsConstructor @Singleton public class SimpleBackupManager implements BackupManager {
|
||||
@Singleton public class SimpleBackupManager implements BackupManager {
|
||||
|
||||
@Getter private final Path backupPath;
|
||||
private final Path backupPath;
|
||||
private final boolean automaticBackup;
|
||||
@Getter private final int backupLimit;
|
||||
private final int backupLimit;
|
||||
private final Cache<PlotCacheKey, BackupProfile> backupProfileCache = CacheBuilder.newBuilder()
|
||||
.expireAfterAccess(3, TimeUnit.MINUTES).build();
|
||||
private final PlayerBackupProfileFactory playerBackupProfileFactory;
|
||||
@ -70,6 +67,14 @@ import java.util.concurrent.TimeUnit;
|
||||
this.backupLimit = Settings.Backup.BACKUP_LIMIT;
|
||||
}
|
||||
|
||||
public SimpleBackupManager(final Path backupPath, final boolean automaticBackup,
|
||||
final int backupLimit, final PlayerBackupProfileFactory playerBackupProfileFactory) {
|
||||
this.backupPath = backupPath;
|
||||
this.automaticBackup = automaticBackup;
|
||||
this.backupLimit = backupLimit;
|
||||
this.playerBackupProfileFactory = playerBackupProfileFactory;
|
||||
}
|
||||
|
||||
@Override @Nonnull public BackupProfile getProfile(@Nonnull final Plot plot) {
|
||||
if (plot.hasOwner() && !plot.isMerged()) {
|
||||
try {
|
||||
@ -111,10 +116,22 @@ import java.util.concurrent.TimeUnit;
|
||||
return this.automaticBackup;
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) private static final class PlotCacheKey {
|
||||
public Path getBackupPath() {
|
||||
return this.backupPath;
|
||||
}
|
||||
|
||||
public int getBackupLimit() {
|
||||
return this.backupLimit;
|
||||
}
|
||||
|
||||
private static final class PlotCacheKey {
|
||||
|
||||
private final Plot plot;
|
||||
|
||||
private PlotCacheKey(Plot plot) {
|
||||
this.plot = plot;
|
||||
}
|
||||
|
||||
@Override public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
|
@ -37,9 +37,9 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.TabCompletions;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
@ -27,16 +27,16 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
import com.plotsquared.core.configuration.ConfigurationUtil;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.events.TeleportCause;
|
||||
import com.plotsquared.core.generator.AugmentedUtils;
|
||||
import com.plotsquared.core.generator.HybridPlotWorld;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.player.ConsolePlayer;
|
||||
@ -73,8 +73,8 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -52,9 +52,9 @@ import com.plotsquared.core.util.task.AutoClaimFinishTask;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -36,8 +36,8 @@ import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.nio.file.Files;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
|
@ -39,9 +39,9 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
@ -27,7 +27,6 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.CaptionUtility;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
@ -46,11 +45,12 @@ import com.plotsquared.core.util.Expression;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@CommandDeclaration(command = "claim",
|
||||
aliases = "c",
|
||||
description = "Claim the current plot you're standing on",
|
||||
|
@ -42,8 +42,8 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static com.plotsquared.core.command.SubCommand.sendMessage;
|
||||
|
@ -25,12 +25,10 @@
|
||||
*/
|
||||
package com.plotsquared.core.command;
|
||||
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.Caption;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.StaticCaption;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
@ -39,9 +37,7 @@ import com.plotsquared.core.util.StringComparison;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import lombok.SneakyThrows;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
@ -594,10 +590,6 @@ public abstract class Command {
|
||||
return object;
|
||||
}
|
||||
|
||||
@SneakyThrows protected static void sneakyThrow(@Nonnull final Throwable throwable) {
|
||||
throw throwable;
|
||||
}
|
||||
|
||||
public enum CommandResult {
|
||||
FAILURE, SUCCESS
|
||||
}
|
||||
|
@ -26,12 +26,10 @@
|
||||
package com.plotsquared.core.command;
|
||||
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* CommandCategory.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public enum CommandCategory {
|
||||
/**
|
||||
* Claiming CommandConfig.
|
||||
@ -78,6 +76,10 @@ public enum CommandCategory {
|
||||
*/
|
||||
private final Captions caption;
|
||||
|
||||
CommandCategory(final Captions caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return this.caption.getTranslated();
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
@ -37,6 +37,7 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "continue",
|
||||
|
@ -33,6 +33,7 @@ import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "createroadschematic",
|
||||
|
@ -27,13 +27,13 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.database.DBFunc;
|
||||
import com.plotsquared.core.database.Database;
|
||||
import com.plotsquared.core.database.MySQL;
|
||||
import com.plotsquared.core.database.SQLManager;
|
||||
import com.plotsquared.core.database.SQLite;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.listener.PlotListener;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
@ -45,8 +45,8 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.query.PlotQuery;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -39,10 +39,10 @@ import com.plotsquared.core.util.query.PlotQuery;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import com.plotsquared.core.uuid.UUIDMapping;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import javax.annotation.Nonnull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
|
@ -63,11 +63,11 @@ import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.script.Bindings;
|
||||
import javax.script.ScriptContext;
|
||||
import javax.script.ScriptEngine;
|
||||
|
@ -37,8 +37,8 @@ import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -29,10 +29,10 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.inject.annotations.ConfigFile;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.inject.annotations.ConfigFile;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.PremiumVerification;
|
||||
@ -40,7 +40,6 @@ import com.plotsquared.core.util.net.IncendoPaster;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
|
@ -35,8 +35,8 @@ import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotManager;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
|
||||
@CommandDeclaration(command = "debugroadregen",
|
||||
|
@ -39,6 +39,7 @@ import com.plotsquared.core.util.Expression;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -39,8 +39,8 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.TabCompletions;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
@ -35,6 +35,7 @@ import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.flag.implementations.DescriptionFlag;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "setdescription",
|
||||
|
@ -27,6 +27,7 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "dislike",
|
||||
|
@ -43,6 +43,7 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "done",
|
||||
|
@ -39,8 +39,8 @@ import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.net.URL;
|
||||
|
||||
@CommandDeclaration(usage = "/plot download [schematic|world]",
|
||||
|
@ -49,10 +49,9 @@ import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.helpmenu.HelpMenu;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -41,8 +41,8 @@ import com.plotsquared.core.util.query.PlotQuery;
|
||||
import com.plotsquared.core.util.query.SortingStrategy;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -37,8 +37,8 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.TabCompletions;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
@ -33,8 +33,8 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
@ -40,8 +40,8 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
@ -27,7 +27,6 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.CaptionUtility;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.caption.Templates;
|
||||
@ -50,9 +49,9 @@ import com.plotsquared.core.util.TabCompletions;
|
||||
import com.plotsquared.core.util.query.PlotQuery;
|
||||
import com.plotsquared.core.util.query.SortingStrategy;
|
||||
import com.plotsquared.core.uuid.UUIDMapping;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -39,8 +39,8 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.SchematicHandler;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
@ -42,9 +42,9 @@ import com.plotsquared.core.util.Expression;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandDeclaration(command = "merge",
|
||||
|
@ -36,8 +36,8 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@CommandDeclaration(usage = "/plot move <X;Z>",
|
||||
|
@ -39,8 +39,8 @@ import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
import com.plotsquared.core.plot.flag.implementations.MusicFlag;
|
||||
import com.plotsquared.core.util.InventoryUtil;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
|
@ -38,8 +38,8 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
@ -40,8 +40,8 @@ import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
@ -44,8 +44,8 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.MathMan;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
@ -34,6 +34,7 @@ import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotManager;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "regenallroads",
|
||||
|
@ -27,18 +27,18 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
import com.plotsquared.core.configuration.MemorySection;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.PlotAreaType;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
@ -35,8 +35,8 @@ import com.plotsquared.core.util.EventDispatcher;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.TabCompletions;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
@ -38,8 +38,8 @@ import com.plotsquared.core.util.SchematicHandler;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -42,8 +42,8 @@ import com.plotsquared.core.util.SchematicHandler;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -45,8 +45,8 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.world.block.BlockCategory;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -34,8 +34,8 @@ import com.plotsquared.core.setup.SetupProcess;
|
||||
import com.plotsquared.core.setup.SetupStep;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.SetupUtils;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -27,8 +27,6 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.ConfigurationNode;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
@ -36,6 +34,8 @@ import com.plotsquared.core.configuration.InvalidConfigurationException;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.events.TeleportCause;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotManager;
|
||||
@ -48,8 +48,8 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.SetupUtils;
|
||||
import com.plotsquared.core.util.WorldUtil;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -47,8 +47,8 @@ import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -36,8 +36,8 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.TabCompletions;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
@ -37,6 +37,7 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@CommandDeclaration(command = "unlink",
|
||||
|
@ -42,8 +42,8 @@ import com.plotsquared.core.util.query.PlotQuery;
|
||||
import com.plotsquared.core.util.query.SortingStrategy;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -30,8 +30,8 @@ import com.plotsquared.core.configuration.serialization.SerializableAs;
|
||||
import com.plotsquared.core.generator.ClassicPlotManagerComponent;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -44,11 +44,11 @@ import com.plotsquared.core.util.PatternUtil;
|
||||
import com.plotsquared.core.util.Permissions;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -26,9 +26,6 @@
|
||||
package com.plotsquared.core.configuration;
|
||||
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -42,14 +39,40 @@ public interface ChatFormatter {
|
||||
|
||||
void format(ChatContext context);
|
||||
|
||||
@AllArgsConstructor
|
||||
final class ChatContext {
|
||||
|
||||
@Getter private final PlotPlayer recipient;
|
||||
@Getter @Setter private String message;
|
||||
@Getter private final Object[] args;
|
||||
@Getter private final boolean rawOutput;
|
||||
private final PlotPlayer<?> recipient;
|
||||
private String message;
|
||||
private final Object[] args;
|
||||
private final boolean rawOutput;
|
||||
|
||||
public ChatContext(final PlotPlayer<?> recipient, final String message, final Object[] args,
|
||||
final boolean rawOutput) {
|
||||
this.recipient = recipient;
|
||||
this.message = message;
|
||||
this.args = args;
|
||||
this.rawOutput = rawOutput;
|
||||
}
|
||||
|
||||
public PlotPlayer<?> getRecipient() {
|
||||
return this.recipient;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public Object[] getArgs() {
|
||||
return this.args;
|
||||
}
|
||||
|
||||
public boolean isRawOutput() {
|
||||
return this.rawOutput;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ package com.plotsquared.core.configuration;
|
||||
import com.plotsquared.core.plot.BlockBucket;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -40,11 +39,11 @@ import java.util.List;
|
||||
*/
|
||||
public class ConfigurationNode {
|
||||
|
||||
@Getter private final String constant;
|
||||
private final String constant;
|
||||
private final Object defaultValue;
|
||||
@Getter private final String description;
|
||||
private final String description;
|
||||
private final ConfigurationUtil.SettingValue type;
|
||||
@Getter private final Collection<String> suggestions;
|
||||
private final Collection<String> suggestions;
|
||||
private Object value;
|
||||
|
||||
public ConfigurationNode(String constant, Object defaultValue, String description,
|
||||
@ -112,4 +111,16 @@ public class ConfigurationNode {
|
||||
}
|
||||
return this.defaultValue;
|
||||
}
|
||||
|
||||
public String getConstant() {
|
||||
return this.constant;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public Collection<String> getSuggestions() {
|
||||
return this.suggestions;
|
||||
}
|
||||
}
|
||||
|
@ -30,11 +30,9 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.biome.BiomeTypes;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import lombok.Getter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
/**
|
||||
* Main Configuration Utility
|
||||
*/
|
||||
@ -104,13 +102,16 @@ public class ConfigurationUtil {
|
||||
|
||||
public static final class UnknownBlockException extends IllegalArgumentException {
|
||||
|
||||
@Getter private final String unknownValue;
|
||||
private final String unknownValue;
|
||||
|
||||
UnknownBlockException(@Nonnull final String unknownValue) {
|
||||
super(String.format("\"%s\" is not a valid block", unknownValue));
|
||||
this.unknownValue = unknownValue;
|
||||
}
|
||||
|
||||
public String getUnknownValue() {
|
||||
return this.unknownValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -137,13 +138,16 @@ public class ConfigurationUtil {
|
||||
|
||||
public static final class UnsafeBlockException extends IllegalArgumentException {
|
||||
|
||||
@Getter private final BlockState unsafeBlock;
|
||||
private final BlockState unsafeBlock;
|
||||
|
||||
UnsafeBlockException(@Nonnull final BlockState unsafeBlock) {
|
||||
super(String.format("%s is not a valid block", unsafeBlock));
|
||||
this.unsafeBlock = unsafeBlock;
|
||||
}
|
||||
|
||||
public BlockState getUnsafeBlock() {
|
||||
return this.unsafeBlock;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,21 +27,18 @@ package com.plotsquared.core.configuration;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public final class StaticCaption implements Caption {
|
||||
|
||||
private final String value;
|
||||
private final boolean usePrefix;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #of(String)}
|
||||
*/
|
||||
@Deprecated public StaticCaption(final String value) {
|
||||
this(value, true);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,8 @@
|
||||
package com.plotsquared.core.configuration.caption;
|
||||
|
||||
import com.plotsquared.core.configuration.Caption;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* A {@link com.plotsquared.core.configuration.Caption} that can be identified by a key
|
||||
@ -38,6 +39,6 @@ public interface KeyedCaption extends Caption {
|
||||
*
|
||||
* @return Caption key
|
||||
*/
|
||||
@NonNull String getKey();
|
||||
@Nonnull String getKey();
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ package com.plotsquared.core.configuration.caption;
|
||||
import com.plotsquared.core.configuration.Caption;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
|
||||
@ -38,10 +37,14 @@ import java.util.UUID;
|
||||
/**
|
||||
* Utility class that generates {@link net.kyori.adventure.text.minimessage.Template templates}
|
||||
*/
|
||||
@UtilityClass
|
||||
public class Templates {
|
||||
public final class Templates {
|
||||
|
||||
private final MiniMessage MINI_MESSAGE = MiniMessage.builder().build();
|
||||
private static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build();
|
||||
|
||||
private Templates() {
|
||||
throw new UnsupportedOperationException(
|
||||
"This is a utility class and cannot be instantiated");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link net.kyori.adventure.text.minimessage.Template} from a PlotSquared {@link Caption}
|
||||
@ -52,10 +55,9 @@ public class Templates {
|
||||
* @param replacements Replacements
|
||||
* @return Generated template
|
||||
*/
|
||||
@Nonnull public Template of(@Nonnull final LocaleHolder localeHolder,
|
||||
@Nonnull final String key,
|
||||
@Nonnull final Caption caption,
|
||||
@Nonnull final Template... replacements) {
|
||||
@Nonnull public static Template of(@Nonnull final LocaleHolder localeHolder,
|
||||
@Nonnull final String key, @Nonnull final Caption caption,
|
||||
@Nonnull final Template... replacements) {
|
||||
return Template.of(key, MINI_MESSAGE.parse(caption.getComponent(localeHolder), replacements));
|
||||
}
|
||||
|
||||
@ -66,8 +68,7 @@ public class Templates {
|
||||
* @param uuid Player UUID
|
||||
* @return Generated template
|
||||
*/
|
||||
@Nonnull public Template of(@Nonnull final String key,
|
||||
@Nonnull final UUID uuid) {
|
||||
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final UUID uuid) {
|
||||
final String username = MainUtil.getName(uuid);
|
||||
return Template.of(key, username);
|
||||
}
|
||||
@ -79,8 +80,7 @@ public class Templates {
|
||||
* @param value Template value
|
||||
* @return Generated template
|
||||
*/
|
||||
@Nonnull public Template of(@Nonnull final String key,
|
||||
@Nonnull final String value) {
|
||||
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final String value) {
|
||||
return Template.of(key, value);
|
||||
}
|
||||
|
||||
@ -91,8 +91,7 @@ public class Templates {
|
||||
* @param area Plot area
|
||||
* @return Generated template
|
||||
*/
|
||||
@Nonnull public Template of(@Nonnull final String key,
|
||||
@Nonnull final PlotArea area) {
|
||||
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final PlotArea area) {
|
||||
return Template.of(key, area.toString());
|
||||
}
|
||||
|
||||
@ -103,8 +102,7 @@ public class Templates {
|
||||
* @param number Number
|
||||
* @return Generated template
|
||||
*/
|
||||
@Nonnull public Template of(@Nonnull final String key,
|
||||
@Nonnull final Number number) {
|
||||
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final Number number) {
|
||||
return Template.of(key, number.toString());
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.core.configuration.caption;
|
||||
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import lombok.Getter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
@ -36,7 +35,7 @@ import java.util.Locale;
|
||||
*/
|
||||
public final class TranslatableCaption implements KeyedCaption {
|
||||
|
||||
@Getter private final String key;
|
||||
private final String key;
|
||||
|
||||
private TranslatableCaption(@Nonnull final String key) {
|
||||
this.key = key;
|
||||
@ -56,4 +55,7 @@ public final class TranslatableCaption implements KeyedCaption {
|
||||
return PlotSquared.get().getCaptionMap().getMessage(this, localeHolder);
|
||||
}
|
||||
|
||||
@Nonnull public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ import com.plotsquared.core.plot.PlotId;
|
||||
import com.plotsquared.core.plot.comment.PlotComment;
|
||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -27,12 +27,11 @@ package com.plotsquared.core.database;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.Storage;
|
||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.listener.PlotListener;
|
||||
import com.plotsquared.core.location.BlockLoc;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
@ -51,10 +50,10 @@ import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import javax.annotation.Nonnull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
|
@ -28,8 +28,6 @@ package com.plotsquared.core.events;
|
||||
import com.plotsquared.core.command.Claim;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -37,10 +35,10 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve
|
||||
|
||||
private Result eventResult;
|
||||
private String schematic;
|
||||
@Getter private PlotPlayer player;
|
||||
@Getter private PlotArea plotArea;
|
||||
@Getter @Setter private int size_x;
|
||||
@Getter @Setter private int size_z;
|
||||
private final PlotPlayer<?> player;
|
||||
private final PlotArea plotArea;
|
||||
private int size_x;
|
||||
private int size_z;
|
||||
|
||||
/**
|
||||
* PlayerAutoPlotEvent: called when a player attempts to auto claim a plot.
|
||||
@ -51,7 +49,7 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve
|
||||
* @param size_x The size of the auto area
|
||||
* @param size_z The size of the auto area
|
||||
*/
|
||||
public PlayerAutoPlotEvent(PlotPlayer player, PlotArea plotArea, @Nullable String schematic,
|
||||
public PlayerAutoPlotEvent(PlotPlayer<?> player, PlotArea plotArea, @Nullable String schematic,
|
||||
int size_x, int size_z) {
|
||||
super(null);
|
||||
this.player = player;
|
||||
@ -84,4 +82,28 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve
|
||||
@Override public void setEventResult(Result e) {
|
||||
this.eventResult = e;
|
||||
}
|
||||
|
||||
public PlotPlayer<?> getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public PlotArea getPlotArea() {
|
||||
return this.plotArea;
|
||||
}
|
||||
|
||||
public int getSize_x() {
|
||||
return this.size_x;
|
||||
}
|
||||
|
||||
public int getSize_z() {
|
||||
return this.size_z;
|
||||
}
|
||||
|
||||
public void setSize_x(int size_x) {
|
||||
this.size_x = size_x;
|
||||
}
|
||||
|
||||
public void setSize_z(int size_z) {
|
||||
this.size_z = size_z;
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,8 @@ package com.plotsquared.core.events;
|
||||
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
import lombok.Getter;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@ -40,7 +39,7 @@ import java.util.List;
|
||||
public final class PlotAutoMergeEvent extends PlotEvent implements CancellablePlotEvent {
|
||||
|
||||
private final List<PlotId> plots;
|
||||
@Getter private final String world;
|
||||
private final String world;
|
||||
private Result eventResult;
|
||||
|
||||
/**
|
||||
@ -73,4 +72,8 @@ public final class PlotAutoMergeEvent extends PlotEvent implements CancellablePl
|
||||
@Override public void setEventResult(Result e) {
|
||||
this.eventResult = e;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ package com.plotsquared.core.events;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEvent {
|
||||
|
@ -26,6 +26,7 @@
|
||||
package com.plotsquared.core.events;
|
||||
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class PlotEvent {
|
||||
|
@ -28,8 +28,7 @@ package com.plotsquared.core.events;
|
||||
import com.plotsquared.core.location.Direction;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
@ -38,11 +37,11 @@ import javax.annotation.Nonnull;
|
||||
*/
|
||||
public final class PlotMergeEvent extends PlotPlayerEvent implements CancellablePlotEvent {
|
||||
|
||||
@Getter private final String world;
|
||||
@Getter @Setter private Direction dir;
|
||||
@Getter @Setter private int max;
|
||||
private final String world;
|
||||
private Direction dir;
|
||||
private int max;
|
||||
private Result eventResult;
|
||||
@Getter private PlotPlayer player;
|
||||
private PlotPlayer player;
|
||||
|
||||
/**
|
||||
* PlotMergeEvent: Called when plots are merged
|
||||
@ -54,7 +53,7 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable
|
||||
* @param player The player attempting the merge
|
||||
*/
|
||||
public PlotMergeEvent(@Nonnull final String world, @Nonnull final Plot plot,
|
||||
@Nonnull final Direction dir, final int max, PlotPlayer player) {
|
||||
@Nonnull final Direction dir, final int max, final PlotPlayer<?> player) {
|
||||
super(player, plot);
|
||||
this.world = world;
|
||||
this.dir = dir;
|
||||
@ -70,4 +69,28 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable
|
||||
@Override public void setEventResult(Result e) {
|
||||
this.eventResult = e;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
|
||||
public Direction getDir() {
|
||||
return this.dir;
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
return this.max;
|
||||
}
|
||||
|
||||
public PlotPlayer getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setDir(Direction dir) {
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
public void setMax(int max) {
|
||||
this.max = max;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ package com.plotsquared.core.events;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.Rating;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class PlotRateEvent extends PlotEvent implements CancellablePlotEvent {
|
||||
|
@ -27,8 +27,7 @@ package com.plotsquared.core.events;
|
||||
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
@ -37,10 +36,10 @@ import javax.annotation.Nonnull;
|
||||
*/
|
||||
public final class PlotUnlinkEvent extends PlotEvent implements CancellablePlotEvent {
|
||||
|
||||
@Getter private final PlotArea area;
|
||||
@Getter @Setter boolean createRoad;
|
||||
@Getter @Setter boolean createSign;
|
||||
@Getter REASON reason;
|
||||
private final PlotArea area;
|
||||
boolean createRoad;
|
||||
boolean createSign;
|
||||
REASON reason;
|
||||
private Result eventResult = Result.ACCEPT;
|
||||
|
||||
/**
|
||||
@ -69,6 +68,30 @@ public final class PlotUnlinkEvent extends PlotEvent implements CancellablePlotE
|
||||
this.eventResult = e;
|
||||
}
|
||||
|
||||
public PlotArea getArea() {
|
||||
return this.area;
|
||||
}
|
||||
|
||||
public boolean isCreateRoad() {
|
||||
return this.createRoad;
|
||||
}
|
||||
|
||||
public boolean isCreateSign() {
|
||||
return this.createSign;
|
||||
}
|
||||
|
||||
public REASON getReason() {
|
||||
return this.reason;
|
||||
}
|
||||
|
||||
public void setCreateRoad(boolean createRoad) {
|
||||
this.createRoad = createRoad;
|
||||
}
|
||||
|
||||
public void setCreateSign(boolean createSign) {
|
||||
this.createSign = createSign;
|
||||
}
|
||||
|
||||
public enum REASON {
|
||||
NEW_OWNER, PLAYER_COMMAND, CLEAR, DELETE, EXPIRE_DELETE
|
||||
}
|
||||
|
@ -39,9 +39,9 @@ import com.plotsquared.core.util.RegionUtil;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class AugmentedUtils {
|
||||
|
@ -40,8 +40,8 @@ import com.plotsquared.core.util.RegionManager;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.core.generator;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
@ -35,6 +35,7 @@ import com.plotsquared.core.plot.PlotId;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -31,6 +31,7 @@ import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -38,6 +38,7 @@ import com.plotsquared.core.util.MathMan;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class HybridGen extends IndependentPlotGenerator {
|
||||
|
@ -46,9 +46,8 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import lombok.Getter;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
@ -58,7 +57,7 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
|
||||
public static boolean REGENERATIVE_CLEAR = true;
|
||||
|
||||
@Getter private final HybridPlotWorld hybridPlotWorld;
|
||||
private final HybridPlotWorld hybridPlotWorld;
|
||||
private final RegionManager regionManager;
|
||||
|
||||
public HybridPlotManager(@Nonnull final HybridPlotWorld hybridPlotWorld,
|
||||
@ -280,4 +279,8 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
@Override public Location getSignLoc(Plot plot) {
|
||||
return hybridPlotWorld.getSignLocation(plot);
|
||||
}
|
||||
|
||||
public HybridPlotWorld getHybridPlotWorld() {
|
||||
return this.hybridPlotWorld;
|
||||
}
|
||||
}
|
||||
|
@ -55,12 +55,11 @@ import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
import com.sk89q.worldedit.util.Direction;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import lombok.Getter;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
@ -80,7 +79,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
public HashMap<Integer, BiomeType> G_SCH_B;
|
||||
public int SCHEM_Y;
|
||||
private Location SIGN_LOCATION;
|
||||
@Getter private File root = null;
|
||||
private File root = null;
|
||||
|
||||
private final RegionManager regionManager;
|
||||
private final SchematicHandler schematicHandler;
|
||||
@ -404,4 +403,8 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
int pair = MathMan.pair(x, z);
|
||||
this.G_SCH_B.put(pair, id);
|
||||
}
|
||||
|
||||
public File getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.core.generator;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.events.PlotFlagAddEvent;
|
||||
import com.plotsquared.core.events.Result;
|
||||
@ -65,8 +64,8 @@ import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
|
@ -35,6 +35,7 @@ import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
||||
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
||||
import com.sk89q.worldedit.world.biome.BiomeTypes;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SingleWorldGenerator extends IndependentPlotGenerator {
|
||||
|
@ -35,8 +35,8 @@ import com.plotsquared.core.util.RegionManager;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -32,11 +32,12 @@ import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class SquarePlotWorld extends GridPlotWorld {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("P2/" + SquarePlotWorld.class.getSimpleName());
|
||||
|
@ -29,6 +29,7 @@ import com.google.inject.assistedinject.Assisted;
|
||||
import com.plotsquared.core.generator.HybridPlotWorld;
|
||||
import com.plotsquared.core.generator.IndependentPlotGenerator;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -27,8 +27,8 @@ package com.plotsquared.core.inject.factory;
|
||||
|
||||
import com.plotsquared.core.backup.PlayerBackupProfile;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface PlayerBackupProfileFactory {
|
||||
|
@ -67,9 +67,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
@ -44,8 +44,8 @@ import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -45,8 +45,8 @@ import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.eventbus.EventHandler.Priority;
|
||||
import com.sk89q.worldedit.util.eventbus.Subscribe;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Set;
|
||||
|
||||
public class WESubscriber {
|
||||
|
@ -31,8 +31,6 @@ import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import org.khelekore.prtree.MBR;
|
||||
import org.khelekore.prtree.SimpleMBR;
|
||||
|
||||
@ -42,12 +40,12 @@ import javax.annotation.Nullable;
|
||||
/**
|
||||
* An unmodifiable 6-tuple (world,x,y,z,yaw,pitch)
|
||||
*/
|
||||
@EqualsAndHashCode @SuppressWarnings("unused")
|
||||
@SuppressWarnings("unused")
|
||||
public final class Location implements Comparable<Location> {
|
||||
|
||||
@Getter private final float yaw;
|
||||
@Getter private final float pitch;
|
||||
@Getter private final BlockVector3 blockVector3;
|
||||
private final float yaw;
|
||||
private final float pitch;
|
||||
private final BlockVector3 blockVector3;
|
||||
private final World<?> world;
|
||||
|
||||
private Location(@Nonnull final World<?> world, @Nonnull final BlockVector3 blockVector3,
|
||||
@ -451,4 +449,51 @@ public final class Location implements Comparable<Location> {
|
||||
+ this.getZ() + ",\"yaw\":" + this.yaw + ",\"pitch\":" + this.pitch + ",\"world\":\""
|
||||
+ this.world + "\"}";
|
||||
}
|
||||
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this)
|
||||
return true;
|
||||
if (!(o instanceof Location))
|
||||
return false;
|
||||
final Location other = (Location) o;
|
||||
if (Float.compare(this.yaw, other.yaw) != 0)
|
||||
return false;
|
||||
if (Float.compare(this.pitch, other.pitch) != 0)
|
||||
return false;
|
||||
final Object this$blockVector3 = this.blockVector3;
|
||||
final Object other$blockVector3 = other.blockVector3;
|
||||
if (this$blockVector3 == null ?
|
||||
other$blockVector3 != null :
|
||||
!this$blockVector3.equals(other$blockVector3))
|
||||
return false;
|
||||
final Object this$world = this.getWorld();
|
||||
final Object other$world = other.getWorld();
|
||||
if (this$world == null ? other$world != null : !this$world.equals(other$world))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
result = result * PRIME + Float.floatToIntBits(this.yaw);
|
||||
result = result * PRIME + Float.floatToIntBits(this.pitch);
|
||||
final Object $blockVector3 = this.blockVector3;
|
||||
result = result * PRIME + ($blockVector3 == null ? 43 : $blockVector3.hashCode());
|
||||
final Object $world = this.getWorld();
|
||||
result = result * PRIME + ($world == null ? 43 : $world.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
public float getYaw() {
|
||||
return this.yaw;
|
||||
}
|
||||
|
||||
public float getPitch() {
|
||||
return this.pitch;
|
||||
}
|
||||
|
||||
public BlockVector3 getBlockVector3() {
|
||||
return this.blockVector3;
|
||||
}
|
||||
}
|
||||
|
@ -26,16 +26,12 @@
|
||||
package com.plotsquared.core.location;
|
||||
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
//todo better description needed
|
||||
|
||||
|
||||
/**
|
||||
* (x,y,z) or (x,z) representation for PlotSquared (hence the "Plot" prefix)
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public final class PlotLoc {
|
||||
|
||||
private final int x;
|
||||
@ -52,6 +48,12 @@ public final class PlotLoc {
|
||||
this(x, -1, z);
|
||||
}
|
||||
|
||||
public PlotLoc(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
@Nullable public static PlotLoc fromString(final String input) {
|
||||
if (input == null || "side".equalsIgnoreCase(input)) {
|
||||
return null;
|
||||
|
@ -36,21 +36,18 @@ import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
/**
|
||||
* A block bucket is a container of block types, where each block
|
||||
* has a specified chance of being randomly picked
|
||||
*/
|
||||
@EqualsAndHashCode(of = {"input"})
|
||||
@SuppressWarnings({"unused", "WeakerAccess"})
|
||||
public final class BlockBucket implements ConfigurationSerializable {
|
||||
private static java.util.regex.Pattern regex = java.util.regex.Pattern.compile(
|
||||
@ -60,21 +57,21 @@ public final class BlockBucket implements ConfigurationSerializable {
|
||||
private BlockState single;
|
||||
private Pattern pattern;
|
||||
|
||||
public BlockBucket(BlockType type) {
|
||||
public BlockBucket(@NotNull final BlockType type) {
|
||||
this(type.getId());
|
||||
this.single = type.getDefaultState();
|
||||
this.pattern = new BlockPattern(this.single);
|
||||
this.compiled = true;
|
||||
}
|
||||
|
||||
public BlockBucket(BlockState state) {
|
||||
public BlockBucket(@NotNull final BlockState state) {
|
||||
this(state.getAsString());
|
||||
this.single = state;
|
||||
this.pattern = new BlockPattern(this.single);
|
||||
this.compiled = true;
|
||||
}
|
||||
|
||||
public BlockBucket(String input) {
|
||||
public BlockBucket(@NotNull final String input) {
|
||||
this.input = new StringBuilder(input);
|
||||
}
|
||||
|
||||
@ -194,14 +191,38 @@ public final class BlockBucket implements ConfigurationSerializable {
|
||||
return ImmutableMap.of("blocks", this.toString());
|
||||
}
|
||||
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@RequiredArgsConstructor
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof BlockBucket)) {
|
||||
return false;
|
||||
}
|
||||
final BlockBucket other = (BlockBucket) o;
|
||||
final Object this$input = this.input;
|
||||
final Object other$input = other.input;
|
||||
return Objects.equals(this$input, other$input);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
final Object $input = this.input;
|
||||
result = result * PRIME + ($input == null ? 43 : $input.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
private static final class Range {
|
||||
|
||||
private final int min;
|
||||
private final int max;
|
||||
@Getter private final boolean automatic;
|
||||
private final boolean automatic;
|
||||
|
||||
public Range(int min, int max, boolean automatic) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.automatic = automatic;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return max - min;
|
||||
@ -210,5 +231,41 @@ public final class BlockBucket implements ConfigurationSerializable {
|
||||
public boolean isInRange(final int num) {
|
||||
return num <= max && num >= min;
|
||||
}
|
||||
|
||||
public int getMin() {
|
||||
return this.min;
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
return this.max;
|
||||
}
|
||||
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this)
|
||||
return true;
|
||||
if (!(o instanceof Range))
|
||||
return false;
|
||||
final Range other = (Range) o;
|
||||
if (this.getMin() != other.getMin())
|
||||
return false;
|
||||
if (this.getMax() != other.getMax())
|
||||
return false;
|
||||
if (this.isAutomatic() != other.isAutomatic())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
result = result * PRIME + this.getMin();
|
||||
result = result * PRIME + this.getMax();
|
||||
result = result * PRIME + (this.isAutomatic() ? 79 : 97);
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean isAutomatic() {
|
||||
return this.automatic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,12 +74,11 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import lombok.Getter;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.PathIterator;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
@ -112,7 +111,6 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_MOB;
|
||||
import static com.plotsquared.core.util.entity.EntityCategories.CAP_MONSTER;
|
||||
import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
||||
|
||||
|
||||
/**
|
||||
* The plot class<br>
|
||||
* [IMPORTANT]
|
||||
@ -144,7 +142,7 @@ public class Plot {
|
||||
/**
|
||||
* Plot flag container
|
||||
*/
|
||||
@Getter private final FlagContainer flagContainer = new FlagContainer(null);
|
||||
private final FlagContainer flagContainer = new FlagContainer(null);
|
||||
/**
|
||||
* Has the plot changed since the last save cycle?
|
||||
*/
|
||||
@ -3398,4 +3396,7 @@ public class Plot {
|
||||
return FlagContainer.<T, V>castUnsafe(flagInstance).getValue();
|
||||
}
|
||||
|
||||
public FlagContainer getFlagContainer() {
|
||||
return this.flagContainer;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ package com.plotsquared.core.plot;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.collection.QuadMap;
|
||||
import com.plotsquared.core.configuration.CaptionUtility;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
@ -63,14 +62,11 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.biome.BiomeTypes;
|
||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -92,39 +88,39 @@ public abstract class PlotArea {
|
||||
private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotArea.class.getSimpleName());
|
||||
|
||||
protected final ConcurrentHashMap<PlotId, Plot> plots = new ConcurrentHashMap<>();
|
||||
@Getter @Nonnull private final String worldName;
|
||||
@Getter private final String id;
|
||||
@Getter @Nonnull private final PlotManager plotManager;
|
||||
@Getter private final int worldHash;
|
||||
@Nonnull private final String worldName;
|
||||
private final String id;
|
||||
@Nonnull private final PlotManager plotManager;
|
||||
private final int worldHash;
|
||||
private final PlotId min;
|
||||
private final PlotId max;
|
||||
@Getter @Nonnull private final IndependentPlotGenerator generator;
|
||||
@Getter private int maxPlotMembers = 128;
|
||||
@Getter private boolean autoMerge = false;
|
||||
@Setter private boolean allowSigns = true;
|
||||
@Getter private boolean miscSpawnUnowned = false;
|
||||
@Getter private boolean mobSpawning = false;
|
||||
@Getter private boolean mobSpawnerSpawning = false;
|
||||
@Getter private BiomeType plotBiome = BiomeTypes.FOREST;
|
||||
@Getter private boolean plotChat = true;
|
||||
@Getter private boolean forcingPlotChat = false;
|
||||
@Getter private boolean schematicClaimSpecify = false;
|
||||
@Getter private boolean schematicOnClaim = false;
|
||||
@Getter private String schematicFile = "null";
|
||||
@Getter private boolean spawnEggs = false;
|
||||
@Getter private boolean spawnCustom = true;
|
||||
@Getter private boolean spawnBreeding = false;
|
||||
@Getter private PlotAreaType type = PlotAreaType.NORMAL;
|
||||
@Getter private PlotAreaTerrainType terrain = PlotAreaTerrainType.NONE;
|
||||
@Getter private boolean homeAllowNonmember = false;
|
||||
@Getter private PlotLoc nonmemberHome;
|
||||
@Getter @Setter(AccessLevel.PROTECTED) private PlotLoc defaultHome;
|
||||
@Getter private int maxBuildHeight = 256;
|
||||
@Getter private int minBuildHeight = 1;
|
||||
@Getter private GameMode gameMode = GameModes.CREATIVE;
|
||||
@Getter private Map<String, Expression<Double>> prices = new HashMap<>();
|
||||
@Getter(AccessLevel.PROTECTED) private List<String> schematics = new ArrayList<>();
|
||||
@Getter private boolean roadFlags = false;
|
||||
@Nonnull private final IndependentPlotGenerator generator;
|
||||
private int maxPlotMembers = 128;
|
||||
private boolean autoMerge = false;
|
||||
private boolean allowSigns = true;
|
||||
private boolean miscSpawnUnowned = false;
|
||||
private boolean mobSpawning = false;
|
||||
private boolean mobSpawnerSpawning = false;
|
||||
private BiomeType plotBiome = BiomeTypes.FOREST;
|
||||
private boolean plotChat = true;
|
||||
private boolean forcingPlotChat = false;
|
||||
private boolean schematicClaimSpecify = false;
|
||||
private boolean schematicOnClaim = false;
|
||||
private String schematicFile = "null";
|
||||
private boolean spawnEggs = false;
|
||||
private boolean spawnCustom = true;
|
||||
private boolean spawnBreeding = false;
|
||||
private PlotAreaType type = PlotAreaType.NORMAL;
|
||||
private PlotAreaTerrainType terrain = PlotAreaTerrainType.NONE;
|
||||
private boolean homeAllowNonmember = false;
|
||||
private PlotLoc nonmemberHome;
|
||||
private PlotLoc defaultHome;
|
||||
private int maxBuildHeight = 256;
|
||||
private int minBuildHeight = 1;
|
||||
private GameMode gameMode = GameModes.CREATIVE;
|
||||
private Map<String, Expression<Double>> prices = new HashMap<>();
|
||||
private List<String> schematics = new ArrayList<>();
|
||||
private boolean roadFlags = false;
|
||||
private boolean worldBorder = false;
|
||||
private boolean useEconomy = false;
|
||||
private int hash;
|
||||
@ -134,9 +130,9 @@ public abstract class PlotArea {
|
||||
/**
|
||||
* Area flag container
|
||||
*/
|
||||
@Getter private final FlagContainer flagContainer =
|
||||
private final FlagContainer flagContainer =
|
||||
new FlagContainer(GlobalFlagContainer.getInstance());
|
||||
@Getter private final FlagContainer roadFlagContainer =
|
||||
private final FlagContainer roadFlagContainer =
|
||||
new FlagContainer(GlobalFlagContainer.getInstance());
|
||||
|
||||
private final YamlConfiguration worldConfiguration;
|
||||
@ -1176,4 +1172,140 @@ public abstract class PlotArea {
|
||||
final PlotFlag<?, ?> flagInstance = this.roadFlagContainer.getFlagErased(flagClass);
|
||||
return FlagContainer.<T, V>castUnsafe(flagInstance).getValue();
|
||||
}
|
||||
|
||||
@Nonnull public String getWorldName() {
|
||||
return this.worldName;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Nonnull public PlotManager getPlotManager() {
|
||||
return this.plotManager;
|
||||
}
|
||||
|
||||
public int getWorldHash() {
|
||||
return this.worldHash;
|
||||
}
|
||||
|
||||
@Nonnull public IndependentPlotGenerator getGenerator() {
|
||||
return this.generator;
|
||||
}
|
||||
|
||||
public int getMaxPlotMembers() {
|
||||
return this.maxPlotMembers;
|
||||
}
|
||||
|
||||
public boolean isAutoMerge() {
|
||||
return this.autoMerge;
|
||||
}
|
||||
|
||||
public boolean isMiscSpawnUnowned() {
|
||||
return this.miscSpawnUnowned;
|
||||
}
|
||||
|
||||
public boolean isMobSpawning() {
|
||||
return this.mobSpawning;
|
||||
}
|
||||
|
||||
public boolean isMobSpawnerSpawning() {
|
||||
return this.mobSpawnerSpawning;
|
||||
}
|
||||
|
||||
public BiomeType getPlotBiome() {
|
||||
return this.plotBiome;
|
||||
}
|
||||
|
||||
public boolean isPlotChat() {
|
||||
return this.plotChat;
|
||||
}
|
||||
|
||||
public boolean isForcingPlotChat() {
|
||||
return this.forcingPlotChat;
|
||||
}
|
||||
|
||||
public boolean isSchematicClaimSpecify() {
|
||||
return this.schematicClaimSpecify;
|
||||
}
|
||||
|
||||
public boolean isSchematicOnClaim() {
|
||||
return this.schematicOnClaim;
|
||||
}
|
||||
|
||||
public String getSchematicFile() {
|
||||
return this.schematicFile;
|
||||
}
|
||||
|
||||
public boolean isSpawnEggs() {
|
||||
return this.spawnEggs;
|
||||
}
|
||||
|
||||
public boolean isSpawnCustom() {
|
||||
return this.spawnCustom;
|
||||
}
|
||||
|
||||
public boolean isSpawnBreeding() {
|
||||
return this.spawnBreeding;
|
||||
}
|
||||
|
||||
public PlotAreaType getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public PlotAreaTerrainType getTerrain() {
|
||||
return this.terrain;
|
||||
}
|
||||
|
||||
public boolean isHomeAllowNonmember() {
|
||||
return this.homeAllowNonmember;
|
||||
}
|
||||
|
||||
public PlotLoc getNonmemberHome() {
|
||||
return this.nonmemberHome;
|
||||
}
|
||||
|
||||
public PlotLoc getDefaultHome() {
|
||||
return this.defaultHome;
|
||||
}
|
||||
|
||||
public int getMaxBuildHeight() {
|
||||
return this.maxBuildHeight;
|
||||
}
|
||||
|
||||
public int getMinBuildHeight() {
|
||||
return this.minBuildHeight;
|
||||
}
|
||||
|
||||
public GameMode getGameMode() {
|
||||
return this.gameMode;
|
||||
}
|
||||
|
||||
public Map<String, Expression<Double>> getPrices() {
|
||||
return this.prices;
|
||||
}
|
||||
|
||||
protected List<String> getSchematics() {
|
||||
return this.schematics;
|
||||
}
|
||||
|
||||
public boolean isRoadFlags() {
|
||||
return this.roadFlags;
|
||||
}
|
||||
|
||||
public FlagContainer getFlagContainer() {
|
||||
return this.flagContainer;
|
||||
}
|
||||
|
||||
public FlagContainer getRoadFlagContainer() {
|
||||
return this.roadFlagContainer;
|
||||
}
|
||||
|
||||
public void setAllowSigns(boolean allowSigns) {
|
||||
this.allowSigns = allowSigns;
|
||||
}
|
||||
|
||||
protected void setDefaultHome(PlotLoc defaultHome) {
|
||||
this.defaultHome = defaultHome;
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ package com.plotsquared.core.plot;
|
||||
|
||||
import com.plotsquared.core.configuration.Caption;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import lombok.Getter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
@ -40,12 +40,12 @@ public enum PlotAreaType {
|
||||
AUGMENTED(Captions.PLOT_AREA_TYPE_AUGMENTED),
|
||||
PARTIAL(Captions.PLOT_AREA_TYPE_PARTIAL);
|
||||
|
||||
@Getter private final Caption description;
|
||||
private final Caption description;
|
||||
|
||||
private static final Map<String, PlotAreaType> types = Stream.of(values())
|
||||
.collect(Collectors.toMap(e -> e.toString().toLowerCase(), Function.identity()));
|
||||
|
||||
PlotAreaType(Caption description) {
|
||||
PlotAreaType(@Nonnull final Caption description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@ -63,4 +63,8 @@ public enum PlotAreaType {
|
||||
}
|
||||
return Optional.of(values()[typeId]);
|
||||
}
|
||||
|
||||
public Caption getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.RegionUtil;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user