mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Delombok + import organisation
This commit is contained in:
parent
c0a0d36e5d
commit
33b6ef66d6
@ -107,7 +107,6 @@ import com.plotsquared.core.uuid.UUIDPipeline;
|
|||||||
import com.plotsquared.core.uuid.offline.OfflineModeUUIDService;
|
import com.plotsquared.core.uuid.offline.OfflineModeUUIDService;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import lombok.Getter;
|
|
||||||
import net.kyori.adventure.audience.Audience;
|
import net.kyori.adventure.audience.Audience;
|
||||||
import org.bstats.bukkit.Metrics;
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -167,15 +166,15 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int[] version;
|
private int[] version;
|
||||||
@Getter private String pluginName;
|
private String pluginName;
|
||||||
@Getter private SingleWorldListener singleWorldListener;
|
private SingleWorldListener singleWorldListener;
|
||||||
private Method methodUnloadChunk0;
|
private Method methodUnloadChunk0;
|
||||||
private boolean methodUnloadSetup = false;
|
private boolean methodUnloadSetup = false;
|
||||||
private boolean metricsStarted;
|
private boolean metricsStarted;
|
||||||
private EconHandler econ;
|
private EconHandler econ;
|
||||||
private PermHandler perm;
|
private PermHandler perm;
|
||||||
|
|
||||||
@Getter private Injector injector;
|
private Injector injector;
|
||||||
|
|
||||||
@Inject private PlotAreaManager plotAreaManager;
|
@Inject private PlotAreaManager plotAreaManager;
|
||||||
@Inject private EventDispatcher eventDispatcher;
|
@Inject private EventDispatcher eventDispatcher;
|
||||||
@ -1123,4 +1122,15 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
|||||||
return BukkitUtil.BUKKIT_AUDIENCES.audience(Bukkit.getConsoleSender());
|
return BukkitUtil.BUKKIT_AUDIENCES.audience(Bukkit.getConsoleSender());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPluginName() {
|
||||||
|
return this.pluginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingleWorldListener getSingleWorldListener() {
|
||||||
|
return this.singleWorldListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Injector getInjector() {
|
||||||
|
return this.injector;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,15 +25,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.bukkit.entity;
|
package com.plotsquared.bukkit.entity;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@Getter
|
|
||||||
public abstract class EntityWrapper {
|
public abstract class EntityWrapper {
|
||||||
|
|
||||||
protected final float yaw;
|
protected final float yaw;
|
||||||
@ -64,4 +62,31 @@ public abstract class EntityWrapper {
|
|||||||
|
|
||||||
public abstract void saveEntity();
|
public abstract void saveEntity();
|
||||||
|
|
||||||
|
public float getYaw() {
|
||||||
|
return this.yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPitch() {
|
||||||
|
return this.pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return this.entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityType getType() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getX() {
|
||||||
|
return this.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getY() {
|
||||||
|
return this.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getZ() {
|
||||||
|
return this.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@ import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
|||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
final class BlockStatePopulator extends BlockPopulator {
|
final class BlockStatePopulator extends BlockPopulator {
|
||||||
|
@ -29,8 +29,8 @@ import com.plotsquared.core.generator.AugmentedUtils;
|
|||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BukkitAugmentedGenerator extends BlockPopulator {
|
public class BukkitAugmentedGenerator extends BlockPopulator {
|
||||||
|
@ -38,13 +38,12 @@ import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
|||||||
import com.plotsquared.core.util.ChunkManager;
|
import com.plotsquared.core.util.ChunkManager;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import lombok.Getter;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@ -62,7 +61,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
|||||||
private List<BlockPopulator> populators;
|
private List<BlockPopulator> populators;
|
||||||
private boolean loaded = false;
|
private boolean loaded = false;
|
||||||
|
|
||||||
@Getter private final String levelName;
|
private final String levelName;
|
||||||
|
|
||||||
public BukkitPlotGenerator(@Nonnull final String name,
|
public BukkitPlotGenerator(@Nonnull final String name,
|
||||||
@Nonnull final IndependentPlotGenerator generator,
|
@Nonnull final IndependentPlotGenerator generator,
|
||||||
@ -258,4 +257,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
|||||||
return toString().equals(obj.toString()) || toString().equals(obj.getClass().getName());
|
return toString().equals(obj.toString()) || toString().equals(obj.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLevelName() {
|
||||||
|
return this.levelName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
||||||
|
@ -62,16 +62,20 @@ import com.plotsquared.core.util.SetupUtils;
|
|||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
import com.sk89q.worldedit.extension.platform.Actor;
|
import com.sk89q.worldedit.extension.platform.Actor;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@RequiredArgsConstructor public class BukkitModule extends AbstractModule {
|
public class BukkitModule extends AbstractModule {
|
||||||
|
|
||||||
private final BukkitPlatform bukkitPlatform;
|
private final BukkitPlatform bukkitPlatform;
|
||||||
|
|
||||||
|
public BukkitModule(@Nonnull final BukkitPlatform bukkitPlatform) {
|
||||||
|
this.bukkitPlatform = bukkitPlatform;
|
||||||
|
}
|
||||||
|
|
||||||
@Override protected void configure() {
|
@Override protected void configure() {
|
||||||
bind(PlayerManager.class).to(BukkitPlayerManager.class);
|
bind(PlayerManager.class).to(BukkitPlayerManager.class);
|
||||||
bind(JavaPlugin.class).toInstance(bukkitPlatform);
|
bind(JavaPlugin.class).toInstance(bukkitPlatform);
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
package com.plotsquared.bukkit.listener;
|
package com.plotsquared.bukkit.listener;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
@ -53,10 +52,10 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
|
|||||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
import org.bukkit.event.world.ChunkLoadEvent;
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ import org.bukkit.event.world.ChunkLoadEvent;
|
|||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class EntitySpawnListener implements Listener {
|
public class EntitySpawnListener implements Listener {
|
||||||
|
@ -59,8 +59,8 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
import org.bukkit.projectiles.ProjectileSource;
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -215,8 +215,8 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import org.bukkit.projectiles.BlockProjectileSource;
|
import org.bukkit.projectiles.BlockProjectileSource;
|
||||||
import org.bukkit.projectiles.ProjectileSource;
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -37,6 +37,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.world.WorldInitEvent;
|
import org.bukkit.event.world.WorldInitEvent;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -32,9 +32,9 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -27,14 +27,15 @@ package com.plotsquared.bukkit.managers;
|
|||||||
|
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import se.hyperver.hyperverse.Hyperverse;
|
import se.hyperver.hyperverse.Hyperverse;
|
||||||
import se.hyperver.hyperverse.world.WorldConfiguration;
|
import se.hyperver.hyperverse.world.WorldConfiguration;
|
||||||
import se.hyperver.hyperverse.world.WorldConfigurationBuilder;
|
import se.hyperver.hyperverse.world.WorldConfigurationBuilder;
|
||||||
import se.hyperver.hyperverse.world.WorldFeatures;
|
import se.hyperver.hyperverse.world.WorldFeatures;
|
||||||
import se.hyperver.hyperverse.world.WorldType;
|
import se.hyperver.hyperverse.world.WorldType;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hyperverse specific manager that creates worlds
|
* Hyperverse specific manager that creates worlds
|
||||||
* using Hyperverse's API
|
* using Hyperverse's API
|
||||||
|
@ -28,6 +28,7 @@ package com.plotsquared.bukkit.managers;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ package com.plotsquared.bukkit.player;
|
|||||||
|
|
||||||
import com.plotsquared.core.player.OfflinePlotPlayer;
|
import com.plotsquared.core.player.OfflinePlotPlayer;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class BukkitOfflinePlayer implements OfflinePlotPlayer {
|
public class BukkitOfflinePlayer implements OfflinePlotPlayer {
|
||||||
|
@ -53,9 +53,9 @@ import org.bukkit.event.EventException;
|
|||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||||
import org.bukkit.plugin.RegisteredListener;
|
import org.bukkit.plugin.RegisteredListener;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -33,9 +33,9 @@ import com.plotsquared.core.util.EventDispatcher;
|
|||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,8 +48,8 @@ import org.bukkit.block.Biome;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Container;
|
import org.bukkit.block.Container;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@ -39,15 +39,13 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
|||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.generator.ChunkGenerator.BiomeGrid;
|
import org.bukkit.generator.ChunkGenerator.BiomeGrid;
|
||||||
import org.bukkit.generator.ChunkGenerator.ChunkData;
|
import org.bukkit.generator.ChunkGenerator.ChunkData;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class GenChunk extends ScopedLocalBlockQueue {
|
public class GenChunk extends ScopedLocalBlockQueue {
|
||||||
@ -59,7 +57,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
|
|||||||
public String world;
|
public String world;
|
||||||
public int chunkX;
|
public int chunkX;
|
||||||
public int chunkZ;
|
public int chunkZ;
|
||||||
@Getter @Setter private ChunkData chunkData = null;
|
private ChunkData chunkData = null;
|
||||||
|
|
||||||
public GenChunk() {
|
public GenChunk() {
|
||||||
super(null, Location.at("", 0, 0, 0), Location.at("", 15, 255, 15));
|
super(null, Location.at("", 0, 0, 0), Location.at("", 15, 255, 15));
|
||||||
@ -217,4 +215,12 @@ public class GenChunk extends ScopedLocalBlockQueue {
|
|||||||
toReturn.chunkData = this.chunkData;
|
toReturn.chunkData = this.chunkData;
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ChunkData getChunkData() {
|
||||||
|
return this.chunkData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChunkData(ChunkData chunkData) {
|
||||||
|
this.chunkData = chunkData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import com.plotsquared.core.queue.LocalBlockQueue;
|
|||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,6 +36,7 @@ import com.plotsquared.core.util.PermHandler;
|
|||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@Singleton public class BukkitEconHandler extends EconHandler {
|
@Singleton public class BukkitEconHandler extends EconHandler {
|
||||||
|
@ -29,12 +29,12 @@ import com.google.inject.Inject;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
|
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
|
||||||
import com.plotsquared.core.inject.annotations.WorldFile;
|
|
||||||
import com.plotsquared.core.configuration.ConfigurationNode;
|
import com.plotsquared.core.configuration.ConfigurationNode;
|
||||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.generator.GeneratorWrapper;
|
import com.plotsquared.core.generator.GeneratorWrapper;
|
||||||
|
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||||
|
import com.plotsquared.core.inject.annotations.WorldFile;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.PlotAreaType;
|
import com.plotsquared.core.plot.PlotAreaType;
|
||||||
import com.plotsquared.core.plot.SetupObject;
|
import com.plotsquared.core.plot.SetupObject;
|
||||||
@ -48,8 +48,8 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -32,7 +32,6 @@ import com.plotsquared.bukkit.player.BukkitPlayer;
|
|||||||
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.Caption;
|
import com.plotsquared.core.configuration.Caption;
|
||||||
import com.plotsquared.core.configuration.Captions;
|
|
||||||
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
@ -59,7 +58,6 @@ import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
|||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -101,11 +99,11 @@ import org.bukkit.entity.Snowman;
|
|||||||
import org.bukkit.entity.Tameable;
|
import org.bukkit.entity.Tameable;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
import org.bukkit.entity.WaterMob;
|
import org.bukkit.entity.WaterMob;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -27,14 +27,13 @@ package com.plotsquared.bukkit.util;
|
|||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.plotsquared.core.location.World;
|
import com.plotsquared.core.location.World;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@EqualsAndHashCode @ToString public class BukkitWorld implements World<org.bukkit.World> {
|
public class BukkitWorld implements World<org.bukkit.World> {
|
||||||
|
|
||||||
private static final Map<String, BukkitWorld> worldMap = Maps.newHashMap();
|
private static final Map<String, BukkitWorld> worldMap = Maps.newHashMap();
|
||||||
|
|
||||||
@ -82,4 +81,36 @@ import java.util.Map;
|
|||||||
return this.world.getName();
|
return this.world.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(final Object o) {
|
||||||
|
if (o == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(o instanceof BukkitWorld)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final BukkitWorld other = (BukkitWorld) o;
|
||||||
|
if (!other.canEqual(this)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(this.world, other.world)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean canEqual(final Object other) {
|
||||||
|
return other instanceof BukkitWorld;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode() {
|
||||||
|
final int PRIME = 59;
|
||||||
|
int result = 1;
|
||||||
|
final Object $world = this.world;
|
||||||
|
result = result * PRIME + ($world == null ? 43 : $world.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return "BukkitWorld(world=" + this.world + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,16 +27,15 @@ package com.plotsquared.bukkit.uuid;
|
|||||||
|
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import com.plotsquared.core.uuid.UUIDService;
|
import com.plotsquared.core.uuid.UUIDService;
|
||||||
import net.luckperms.api.model.user.UserManager;
|
import net.alpenblock.bungeeperms.BungeePerms;
|
||||||
|
import net.alpenblock.bungeeperms.io.UUIDPlayerDB;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import net.alpenblock.bungeeperms.BungeePerms;
|
|
||||||
import net.alpenblock.bungeeperms.io.UUIDPlayerDB;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UUID service that uses the BungeePerms API
|
* UUID service that uses the BungeePerms API
|
||||||
|
@ -29,8 +29,8 @@ import com.earth2me.essentials.Essentials;
|
|||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import com.plotsquared.core.uuid.UUIDService;
|
import com.plotsquared.core.uuid.UUIDService;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -31,8 +31,8 @@ import net.luckperms.api.LuckPerms;
|
|||||||
import net.luckperms.api.model.user.UserManager;
|
import net.luckperms.api.model.user.UserManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -31,8 +31,8 @@ import com.plotsquared.core.uuid.UUIDMapping;
|
|||||||
import com.plotsquared.core.uuid.UUIDService;
|
import com.plotsquared.core.uuid.UUIDService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -29,8 +29,8 @@ import com.destroystokyo.paper.profile.PlayerProfile;
|
|||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import com.plotsquared.core.uuid.UUIDService;
|
import com.plotsquared.core.uuid.UUIDService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -30,8 +30,8 @@ import com.plotsquared.core.database.SQLite;
|
|||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import com.plotsquared.core.uuid.UUIDService;
|
import com.plotsquared.core.uuid.UUIDService;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@ -32,10 +32,10 @@ import com.plotsquared.core.uuid.UUIDService;
|
|||||||
import com.sk89q.squirrelid.Profile;
|
import com.sk89q.squirrelid.Profile;
|
||||||
import com.sk89q.squirrelid.resolver.HttpRepositoryService;
|
import com.sk89q.squirrelid.resolver.HttpRepositoryService;
|
||||||
import com.sk89q.squirrelid.resolver.ProfileService;
|
import com.sk89q.squirrelid.resolver.ProfileService;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -11,11 +11,6 @@ dependencies {
|
|||||||
because("Minecraft uses GSON 2.8.0")
|
because("Minecraft uses GSON 2.8.0")
|
||||||
force = true
|
force = true
|
||||||
}
|
}
|
||||||
implementation("org.projectlombok:lombok:1.18.12")
|
|
||||||
compileOnly("org.projectlombok:lombok:1.18.12")
|
|
||||||
testCompileOnly("org.projectlombok:lombok:1.18.8")
|
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.8")
|
|
||||||
testAnnotationProcessor("org.projectlombok:lombok:1.18.8")
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.72")
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.72")
|
||||||
implementation("org.khelekore:prtree:1.7.0-SNAPSHOT")
|
implementation("org.khelekore:prtree:1.7.0-SNAPSHOT")
|
||||||
// Adventure related stuff
|
// Adventure related stuff
|
||||||
|
@ -36,12 +36,6 @@
|
|||||||
<version>3.0.1</version>
|
<version>3.0.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.18.12</version>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sk89q.worldedit</groupId>
|
<groupId>com.sk89q.worldedit</groupId>
|
||||||
<artifactId>worldedit-core</artifactId>
|
<artifactId>worldedit-core</artifactId>
|
||||||
|
@ -37,7 +37,6 @@ import com.plotsquared.core.util.EventDispatcher;
|
|||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.SchematicHandler;
|
import com.plotsquared.core.util.SchematicHandler;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -57,7 +56,10 @@ import java.util.UUID;
|
|||||||
*
|
*
|
||||||
* @version 5
|
* @version 5
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unused", "WeakerAccess"}) @NoArgsConstructor public class PlotAPI {
|
@SuppressWarnings({"unused", "WeakerAccess"}) public class PlotAPI {
|
||||||
|
|
||||||
|
public PlotAPI() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all plots.
|
* Gets all plots.
|
||||||
|
@ -25,11 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core;
|
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.Captions;
|
||||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||||
import com.plotsquared.core.configuration.ConfigurationUtil;
|
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.Settings;
|
||||||
import com.plotsquared.core.configuration.Storage;
|
import com.plotsquared.core.configuration.Storage;
|
||||||
import com.plotsquared.core.configuration.caption.CaptionLoader;
|
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.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.configuration.serialization.ConfigurationSerialization;
|
import com.plotsquared.core.configuration.serialization.ConfigurationSerialization;
|
||||||
import com.plotsquared.core.database.DBFunc;
|
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.PlotAreaManager;
|
||||||
import com.plotsquared.core.plot.world.SinglePlotArea;
|
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||||
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
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.EventDispatcher;
|
||||||
import com.plotsquared.core.util.LegacyConverter;
|
import com.plotsquared.core.util.LegacyConverter;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.MathMan;
|
import com.plotsquared.core.util.MathMan;
|
||||||
import com.plotsquared.core.util.ReflectionUtils;
|
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.query.PlotQuery;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.plotsquared.core.uuid.UUIDPipeline;
|
import com.plotsquared.core.uuid.UUIDPipeline;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import lombok.Getter;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -133,32 +126,32 @@ public class PlotSquared {
|
|||||||
// Current thread
|
// Current thread
|
||||||
private final Thread thread;
|
private final Thread thread;
|
||||||
// UUID pipelines
|
// UUID pipelines
|
||||||
@Getter private final UUIDPipeline impromptuUUIDPipeline =
|
private final UUIDPipeline impromptuUUIDPipeline =
|
||||||
new UUIDPipeline(Executors.newCachedThreadPool());
|
new UUIDPipeline(Executors.newCachedThreadPool());
|
||||||
@Getter private final UUIDPipeline backgroundUUIDPipeline =
|
private final UUIDPipeline backgroundUUIDPipeline =
|
||||||
new UUIDPipeline(Executors.newSingleThreadExecutor());
|
new UUIDPipeline(Executors.newSingleThreadExecutor());
|
||||||
// WorldEdit instance
|
// WorldEdit instance
|
||||||
@Getter private WorldEdit worldedit;
|
private WorldEdit worldedit;
|
||||||
@Getter private File configFile;
|
private File configFile;
|
||||||
@Getter private File worldsFile;
|
private File worldsFile;
|
||||||
public File translationFile; // TODO: REMOVE
|
public File translationFile; // TODO: REMOVE
|
||||||
public YamlConfiguration style; // TODO: REMOVE
|
public YamlConfiguration style; // TODO: REMOVE
|
||||||
@Getter private YamlConfiguration worldConfiguration;
|
private YamlConfiguration worldConfiguration;
|
||||||
// Temporary hold the plots/clusters before the worlds load
|
// Temporary hold the plots/clusters before the worlds load
|
||||||
private HashMap<String, Set<PlotCluster>> clustersTmp;
|
private HashMap<String, Set<PlotCluster>> clustersTmp;
|
||||||
public HashMap<String, HashMap<PlotId, Plot>> plots_tmp;
|
public HashMap<String, HashMap<PlotId, Plot>> plots_tmp;
|
||||||
private YamlConfiguration config;
|
private YamlConfiguration config;
|
||||||
// Localization
|
// Localization
|
||||||
@Getter private CaptionMap captionMap;
|
private CaptionMap captionMap;
|
||||||
// Implementation logger
|
// Implementation logger
|
||||||
@Setter @Getter private ILogger logger;
|
private ILogger logger;
|
||||||
// Platform / Version / Update URL
|
// Platform / Version / Update URL
|
||||||
private PlotVersion version;
|
private PlotVersion version;
|
||||||
// Files and configuration
|
// Files and configuration
|
||||||
@Getter private File jarFile = null; // This file
|
private File jarFile = null; // This file
|
||||||
private File storageFile;
|
private File storageFile;
|
||||||
@Getter private EventDispatcher eventDispatcher;
|
private EventDispatcher eventDispatcher;
|
||||||
@Getter private PlotListener plotListener;
|
private PlotListener plotListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize PlotSquared with the desired Implementation class.
|
* Initialize PlotSquared with the desired Implementation class.
|
||||||
@ -1454,6 +1447,54 @@ public class PlotSquared {
|
|||||||
return config;
|
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 {
|
public enum SortType {
|
||||||
CREATION_DATE, CREATION_DATE_TIMESTAMP, LAST_MODIFIED, DISTANCE_FROM_ORIGIN
|
CREATION_DATE, CREATION_DATE_TIMESTAMP, LAST_MODIFIED, DISTANCE_FROM_ORIGIN
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.backup;
|
package com.plotsquared.core.backup;
|
||||||
|
|
||||||
import lombok.AccessLevel;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
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
|
* Object representing a plot backup. This does not actually contain the
|
||||||
* backup itself, it is just a pointer to an available backup
|
* 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 BackupProfile owner;
|
||||||
private final long creationTime;
|
private final long creationTime;
|
||||||
@Nullable private final Path file;
|
@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
|
* 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.PlotSquared;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
package com.plotsquared.core.backup;
|
package com.plotsquared.core.backup;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
@ -29,9 +29,9 @@ import com.google.inject.Singleton;
|
|||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
package com.plotsquared.core.backup;
|
package com.plotsquared.core.backup;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Collections;
|
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.SchematicHandler;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
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.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import lombok.AccessLevel;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -51,11 +48,11 @@ import java.util.concurrent.TimeUnit;
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@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;
|
private final boolean automaticBackup;
|
||||||
@Getter private final int backupLimit;
|
private final int backupLimit;
|
||||||
private final Cache<PlotCacheKey, BackupProfile> backupProfileCache = CacheBuilder.newBuilder()
|
private final Cache<PlotCacheKey, BackupProfile> backupProfileCache = CacheBuilder.newBuilder()
|
||||||
.expireAfterAccess(3, TimeUnit.MINUTES).build();
|
.expireAfterAccess(3, TimeUnit.MINUTES).build();
|
||||||
private final PlayerBackupProfileFactory playerBackupProfileFactory;
|
private final PlayerBackupProfileFactory playerBackupProfileFactory;
|
||||||
@ -70,6 +67,14 @@ import java.util.concurrent.TimeUnit;
|
|||||||
this.backupLimit = Settings.Backup.BACKUP_LIMIT;
|
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) {
|
@Override @Nonnull public BackupProfile getProfile(@Nonnull final Plot plot) {
|
||||||
if (plot.hasOwner() && !plot.isMerged()) {
|
if (plot.hasOwner() && !plot.isMerged()) {
|
||||||
try {
|
try {
|
||||||
@ -111,10 +116,22 @@ import java.util.concurrent.TimeUnit;
|
|||||||
return this.automaticBackup;
|
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 final Plot plot;
|
||||||
|
|
||||||
|
private PlotCacheKey(Plot plot) {
|
||||||
|
this.plot = plot;
|
||||||
|
}
|
||||||
|
|
||||||
@Override public boolean equals(final Object o) {
|
@Override public boolean equals(final Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -37,9 +37,9 @@ import com.plotsquared.core.util.Permissions;
|
|||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -27,16 +27,16 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
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.Captions;
|
||||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||||
import com.plotsquared.core.configuration.ConfigurationUtil;
|
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.caption.TranslatableCaption;
|
||||||
|
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.events.TeleportCause;
|
import com.plotsquared.core.events.TeleportCause;
|
||||||
import com.plotsquared.core.generator.AugmentedUtils;
|
import com.plotsquared.core.generator.AugmentedUtils;
|
||||||
import com.plotsquared.core.generator.HybridPlotWorld;
|
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.inject.factory.HybridPlotWorldFactory;
|
||||||
import com.plotsquared.core.location.Location;
|
import com.plotsquared.core.location.Location;
|
||||||
import com.plotsquared.core.player.ConsolePlayer;
|
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.CuboidRegion;
|
||||||
import com.sk89q.worldedit.regions.Region;
|
import com.sk89q.worldedit.regions.Region;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
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.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
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.Permissions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneId;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
|
||||||
import com.plotsquared.core.configuration.CaptionUtility;
|
import com.plotsquared.core.configuration.CaptionUtility;
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
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.Permissions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@CommandDeclaration(command = "claim",
|
@CommandDeclaration(command = "claim",
|
||||||
aliases = "c",
|
aliases = "c",
|
||||||
description = "Claim the current plot you're standing on",
|
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.Permissions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import static com.plotsquared.core.command.SubCommand.sendMessage;
|
import static com.plotsquared.core.command.SubCommand.sendMessage;
|
||||||
|
@ -25,12 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.plotsquared.core.command;
|
package com.plotsquared.core.command;
|
||||||
|
|
||||||
import com.plotsquared.core.PlotSquared;
|
|
||||||
import com.plotsquared.core.configuration.Caption;
|
import com.plotsquared.core.configuration.Caption;
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
import com.plotsquared.core.configuration.StaticCaption;
|
import com.plotsquared.core.configuration.StaticCaption;
|
||||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.MathMan;
|
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.StringMan;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
import net.kyori.adventure.text.minimessage.Template;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@ -594,10 +590,6 @@ public abstract class Command {
|
|||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows protected static void sneakyThrow(@Nonnull final Throwable throwable) {
|
|
||||||
throw throwable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CommandResult {
|
public enum CommandResult {
|
||||||
FAILURE, SUCCESS
|
FAILURE, SUCCESS
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,10 @@
|
|||||||
package com.plotsquared.core.command;
|
package com.plotsquared.core.command;
|
||||||
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CommandCategory.
|
* CommandCategory.
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum CommandCategory {
|
public enum CommandCategory {
|
||||||
/**
|
/**
|
||||||
* Claiming CommandConfig.
|
* Claiming CommandConfig.
|
||||||
@ -78,6 +76,10 @@ public enum CommandCategory {
|
|||||||
*/
|
*/
|
||||||
private final Captions caption;
|
private final Captions caption;
|
||||||
|
|
||||||
|
CommandCategory(final Captions caption) {
|
||||||
|
this.caption = caption;
|
||||||
|
}
|
||||||
|
|
||||||
@Override public String toString() {
|
@Override public String toString() {
|
||||||
return this.caption.getTranslated();
|
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.MathMan;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
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.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "continue",
|
@CommandDeclaration(command = "continue",
|
||||||
|
@ -33,6 +33,7 @@ import com.plotsquared.core.location.Location;
|
|||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "createroadschematic",
|
@CommandDeclaration(command = "createroadschematic",
|
||||||
|
@ -27,13 +27,13 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.inject.annotations.WorldConfig;
|
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.database.DBFunc;
|
import com.plotsquared.core.database.DBFunc;
|
||||||
import com.plotsquared.core.database.Database;
|
import com.plotsquared.core.database.Database;
|
||||||
import com.plotsquared.core.database.MySQL;
|
import com.plotsquared.core.database.MySQL;
|
||||||
import com.plotsquared.core.database.SQLManager;
|
import com.plotsquared.core.database.SQLManager;
|
||||||
import com.plotsquared.core.database.SQLite;
|
import com.plotsquared.core.database.SQLite;
|
||||||
|
import com.plotsquared.core.inject.annotations.WorldConfig;
|
||||||
import com.plotsquared.core.listener.PlotListener;
|
import com.plotsquared.core.listener.PlotListener;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.Plot;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.query.PlotQuery;
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
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.util.task.TaskManager;
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
import com.sk89q.worldedit.world.entity.EntityType;
|
import com.sk89q.worldedit.world.entity.EntityType;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -63,11 +63,11 @@ import com.plotsquared.core.util.task.RunnableVal3;
|
|||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import javax.script.Bindings;
|
import javax.script.Bindings;
|
||||||
import javax.script.ScriptContext;
|
import javax.script.ScriptContext;
|
||||||
import javax.script.ScriptEngine;
|
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.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
@ -29,10 +29,10 @@ import com.google.gson.JsonObject;
|
|||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
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.Captions;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
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.player.PlotPlayer;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.PremiumVerification;
|
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 com.plotsquared.core.util.task.TaskManager;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
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.PlotArea;
|
||||||
import com.plotsquared.core.plot.PlotManager;
|
import com.plotsquared.core.plot.PlotManager;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@CommandDeclaration(command = "debugroadregen",
|
@CommandDeclaration(command = "debugroadregen",
|
||||||
|
@ -39,6 +39,7 @@ import com.plotsquared.core.util.Expression;
|
|||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
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.TabCompletions;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.UUID;
|
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.plot.flag.implementations.DescriptionFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "setdescription",
|
@CommandDeclaration(command = "setdescription",
|
||||||
|
@ -27,6 +27,7 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "dislike",
|
@CommandDeclaration(command = "dislike",
|
||||||
|
@ -43,6 +43,7 @@ import com.plotsquared.core.util.EventDispatcher;
|
|||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "done",
|
@CommandDeclaration(command = "done",
|
||||||
|
@ -39,8 +39,8 @@ import com.plotsquared.core.util.StringMan;
|
|||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
@CommandDeclaration(usage = "/plot download [schematic|world]",
|
@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.helpmenu.HelpMenu;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
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.query.SortingStrategy;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
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.Permissions;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -27,7 +27,6 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.configuration.CaptionUtility;
|
|
||||||
import com.plotsquared.core.configuration.Captions;
|
import com.plotsquared.core.configuration.Captions;
|
||||||
import com.plotsquared.core.configuration.Settings;
|
import com.plotsquared.core.configuration.Settings;
|
||||||
import com.plotsquared.core.configuration.caption.Templates;
|
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.PlotQuery;
|
||||||
import com.plotsquared.core.util.query.SortingStrategy;
|
import com.plotsquared.core.util.query.SortingStrategy;
|
||||||
import com.plotsquared.core.uuid.UUIDMapping;
|
import com.plotsquared.core.uuid.UUIDMapping;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
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.SchematicHandler;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@CommandDeclaration(command = "merge",
|
@CommandDeclaration(command = "merge",
|
||||||
|
@ -36,8 +36,8 @@ import com.plotsquared.core.util.MainUtil;
|
|||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
@CommandDeclaration(usage = "/plot move <X;Z>",
|
@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.plot.flag.implementations.MusicFlag;
|
||||||
import com.plotsquared.core.util.InventoryUtil;
|
import com.plotsquared.core.util.InventoryUtil;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Locale;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
@ -40,8 +40,8 @@ import com.plotsquared.core.util.StringMan;
|
|||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
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.MathMan;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map.Entry;
|
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.PlotManager;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "regenallroads",
|
@CommandDeclaration(command = "regenallroads",
|
||||||
|
@ -27,18 +27,18 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
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.Captions;
|
||||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||||
import com.plotsquared.core.configuration.MemorySection;
|
import com.plotsquared.core.configuration.MemorySection;
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
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.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.PlotAreaType;
|
import com.plotsquared.core.plot.PlotAreaType;
|
||||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
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.MainUtil;
|
||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.plotsquared.core.util.TabCompletions;
|
import com.plotsquared.core.util.TabCompletions;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.UUID;
|
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.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
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.StringMan;
|
||||||
import com.plotsquared.core.util.task.RunnableVal;
|
import com.plotsquared.core.util.task.RunnableVal;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
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.BlockCategory;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -34,8 +34,8 @@ import com.plotsquared.core.setup.SetupProcess;
|
|||||||
import com.plotsquared.core.setup.SetupStep;
|
import com.plotsquared.core.setup.SetupStep;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import com.plotsquared.core.util.SetupUtils;
|
import com.plotsquared.core.util.SetupUtils;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -27,8 +27,6 @@ package com.plotsquared.core.command;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.plotsquared.core.PlotSquared;
|
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.Captions;
|
||||||
import com.plotsquared.core.configuration.ConfigurationNode;
|
import com.plotsquared.core.configuration.ConfigurationNode;
|
||||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
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.Settings;
|
||||||
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
import com.plotsquared.core.configuration.file.YamlConfiguration;
|
||||||
import com.plotsquared.core.events.TeleportCause;
|
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.player.PlotPlayer;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.plot.PlotManager;
|
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.SetupUtils;
|
||||||
import com.plotsquared.core.util.WorldUtil;
|
import com.plotsquared.core.util.WorldUtil;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
@ -47,8 +47,8 @@ import com.sk89q.worldedit.math.BlockVector2;
|
|||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
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.TabCompletions;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
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.Permissions;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.plotsquared.core.util.task.TaskManager;
|
import com.plotsquared.core.util.task.TaskManager;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@CommandDeclaration(command = "unlink",
|
@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.query.SortingStrategy;
|
||||||
import com.plotsquared.core.util.task.RunnableVal2;
|
import com.plotsquared.core.util.task.RunnableVal2;
|
||||||
import com.plotsquared.core.util.task.RunnableVal3;
|
import com.plotsquared.core.util.task.RunnableVal3;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -30,8 +30,8 @@ import com.plotsquared.core.configuration.serialization.SerializableAs;
|
|||||||
import com.plotsquared.core.generator.ClassicPlotManagerComponent;
|
import com.plotsquared.core.generator.ClassicPlotManagerComponent;
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -44,11 +44,11 @@ import com.plotsquared.core.util.PatternUtil;
|
|||||||
import com.plotsquared.core.util.Permissions;
|
import com.plotsquared.core.util.Permissions;
|
||||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -26,9 +26,6 @@
|
|||||||
package com.plotsquared.core.configuration;
|
package com.plotsquared.core.configuration;
|
||||||
|
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -42,14 +39,40 @@ public interface ChatFormatter {
|
|||||||
|
|
||||||
void format(ChatContext context);
|
void format(ChatContext context);
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
final class ChatContext {
|
final class ChatContext {
|
||||||
|
|
||||||
@Getter private final PlotPlayer recipient;
|
private final PlotPlayer<?> recipient;
|
||||||
@Getter @Setter private String message;
|
private String message;
|
||||||
@Getter private final Object[] args;
|
private final Object[] args;
|
||||||
@Getter private final boolean rawOutput;
|
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.plot.BlockBucket;
|
||||||
import com.plotsquared.core.util.StringMan;
|
import com.plotsquared.core.util.StringMan;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -40,11 +39,11 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ConfigurationNode {
|
public class ConfigurationNode {
|
||||||
|
|
||||||
@Getter private final String constant;
|
private final String constant;
|
||||||
private final Object defaultValue;
|
private final Object defaultValue;
|
||||||
@Getter private final String description;
|
private final String description;
|
||||||
private final ConfigurationUtil.SettingValue type;
|
private final ConfigurationUtil.SettingValue type;
|
||||||
@Getter private final Collection<String> suggestions;
|
private final Collection<String> suggestions;
|
||||||
private Object value;
|
private Object value;
|
||||||
|
|
||||||
public ConfigurationNode(String constant, Object defaultValue, String description,
|
public ConfigurationNode(String constant, Object defaultValue, String description,
|
||||||
@ -112,4 +111,16 @@ public class ConfigurationNode {
|
|||||||
}
|
}
|
||||||
return this.defaultValue;
|
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.BiomeType;
|
||||||
import com.sk89q.worldedit.world.biome.BiomeTypes;
|
import com.sk89q.worldedit.world.biome.BiomeTypes;
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main Configuration Utility
|
* Main Configuration Utility
|
||||||
*/
|
*/
|
||||||
@ -104,13 +102,16 @@ public class ConfigurationUtil {
|
|||||||
|
|
||||||
public static final class UnknownBlockException extends IllegalArgumentException {
|
public static final class UnknownBlockException extends IllegalArgumentException {
|
||||||
|
|
||||||
@Getter private final String unknownValue;
|
private final String unknownValue;
|
||||||
|
|
||||||
UnknownBlockException(@Nonnull final String unknownValue) {
|
UnknownBlockException(@Nonnull final String unknownValue) {
|
||||||
super(String.format("\"%s\" is not a valid block", unknownValue));
|
super(String.format("\"%s\" is not a valid block", unknownValue));
|
||||||
this.unknownValue = unknownValue;
|
this.unknownValue = unknownValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUnknownValue() {
|
||||||
|
return this.unknownValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -137,13 +138,16 @@ public class ConfigurationUtil {
|
|||||||
|
|
||||||
public static final class UnsafeBlockException extends IllegalArgumentException {
|
public static final class UnsafeBlockException extends IllegalArgumentException {
|
||||||
|
|
||||||
@Getter private final BlockState unsafeBlock;
|
private final BlockState unsafeBlock;
|
||||||
|
|
||||||
UnsafeBlockException(@Nonnull final BlockState unsafeBlock) {
|
UnsafeBlockException(@Nonnull final BlockState unsafeBlock) {
|
||||||
super(String.format("%s is not a valid block", unsafeBlock));
|
super(String.format("%s is not a valid block", unsafeBlock));
|
||||||
this.unsafeBlock = 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.google.common.base.Preconditions;
|
||||||
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
import com.plotsquared.core.configuration.caption.LocaleHolder;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public final class StaticCaption implements Caption {
|
public final class StaticCaption implements Caption {
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
private final boolean usePrefix;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #of(String)}
|
* @deprecated Use {@link #of(String)}
|
||||||
*/
|
*/
|
||||||
@Deprecated public StaticCaption(final String value) {
|
@Deprecated public StaticCaption(final String value) {
|
||||||
this(value, true);
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
package com.plotsquared.core.configuration.caption;
|
package com.plotsquared.core.configuration.caption;
|
||||||
|
|
||||||
import 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
|
* 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
|
* @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.configuration.Caption;
|
||||||
import com.plotsquared.core.plot.PlotArea;
|
import com.plotsquared.core.plot.PlotArea;
|
||||||
import com.plotsquared.core.util.MainUtil;
|
import com.plotsquared.core.util.MainUtil;
|
||||||
import lombok.experimental.UtilityClass;
|
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.Template;
|
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}
|
* Utility class that generates {@link net.kyori.adventure.text.minimessage.Template templates}
|
||||||
*/
|
*/
|
||||||
@UtilityClass
|
public final class Templates {
|
||||||
public 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}
|
* Create a {@link net.kyori.adventure.text.minimessage.Template} from a PlotSquared {@link Caption}
|
||||||
@ -52,10 +55,9 @@ public class Templates {
|
|||||||
* @param replacements Replacements
|
* @param replacements Replacements
|
||||||
* @return Generated template
|
* @return Generated template
|
||||||
*/
|
*/
|
||||||
@Nonnull public Template of(@Nonnull final LocaleHolder localeHolder,
|
@Nonnull public static Template of(@Nonnull final LocaleHolder localeHolder,
|
||||||
@Nonnull final String key,
|
@Nonnull final String key, @Nonnull final Caption caption,
|
||||||
@Nonnull final Caption caption,
|
@Nonnull final Template... replacements) {
|
||||||
@Nonnull final Template... replacements) {
|
|
||||||
return Template.of(key, MINI_MESSAGE.parse(caption.getComponent(localeHolder), replacements));
|
return Template.of(key, MINI_MESSAGE.parse(caption.getComponent(localeHolder), replacements));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,8 +68,7 @@ public class Templates {
|
|||||||
* @param uuid Player UUID
|
* @param uuid Player UUID
|
||||||
* @return Generated template
|
* @return Generated template
|
||||||
*/
|
*/
|
||||||
@Nonnull public Template of(@Nonnull final String key,
|
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final UUID uuid) {
|
||||||
@Nonnull final UUID uuid) {
|
|
||||||
final String username = MainUtil.getName(uuid);
|
final String username = MainUtil.getName(uuid);
|
||||||
return Template.of(key, username);
|
return Template.of(key, username);
|
||||||
}
|
}
|
||||||
@ -79,8 +80,7 @@ public class Templates {
|
|||||||
* @param value Template value
|
* @param value Template value
|
||||||
* @return Generated template
|
* @return Generated template
|
||||||
*/
|
*/
|
||||||
@Nonnull public Template of(@Nonnull final String key,
|
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final String value) {
|
||||||
@Nonnull final String value) {
|
|
||||||
return Template.of(key, value);
|
return Template.of(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,8 +91,7 @@ public class Templates {
|
|||||||
* @param area Plot area
|
* @param area Plot area
|
||||||
* @return Generated template
|
* @return Generated template
|
||||||
*/
|
*/
|
||||||
@Nonnull public Template of(@Nonnull final String key,
|
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final PlotArea area) {
|
||||||
@Nonnull final PlotArea area) {
|
|
||||||
return Template.of(key, area.toString());
|
return Template.of(key, area.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,8 +102,7 @@ public class Templates {
|
|||||||
* @param number Number
|
* @param number Number
|
||||||
* @return Generated template
|
* @return Generated template
|
||||||
*/
|
*/
|
||||||
@Nonnull public Template of(@Nonnull final String key,
|
@Nonnull public static Template of(@Nonnull final String key, @Nonnull final Number number) {
|
||||||
@Nonnull final Number number) {
|
|
||||||
return Template.of(key, number.toString());
|
return Template.of(key, number.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user