Merge branch 'v6' into feature/v6/pipeline-queue

# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitRegionManager.java
#	Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
#	Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
#	Core/src/main/java/com/plotsquared/core/plot/Plot.java
#	Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
#	Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java
#	Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java
This commit is contained in:
dordsor21
2020-07-19 14:29:08 +01:00
55 changed files with 1172 additions and 1429 deletions

View File

@ -44,11 +44,11 @@ import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
import com.plotsquared.bukkit.placeholder.Placeholders;
import com.plotsquared.bukkit.player.BukkitPlayerManager;
import com.plotsquared.bukkit.util.BukkitChatManager;
import com.plotsquared.bukkit.util.task.BukkitTaskManager;
import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.bukkit.util.BukkitWorld;
import com.plotsquared.bukkit.util.SetGenCB;
import com.plotsquared.bukkit.util.UpdateUtility;
import com.plotsquared.bukkit.util.task.BukkitTaskManager;
import com.plotsquared.bukkit.util.task.PaperTimeConverter;
import com.plotsquared.bukkit.util.task.SpigotTimeConverter;
import com.plotsquared.bukkit.uuid.BungeePermsUUIDService;
@ -67,6 +67,7 @@ import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ChatFormatter;
import com.plotsquared.core.configuration.ConfigurationNode;
import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.file.YamlConfiguration;
import com.plotsquared.core.database.DBFunc;
@ -88,6 +89,7 @@ import com.plotsquared.core.plot.PlotAreaTerrainType;
import com.plotsquared.core.plot.PlotAreaType;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.comment.CommentManager;
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
import com.plotsquared.core.plot.message.PlainChatManager;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.plot.world.SinglePlotArea;
@ -98,7 +100,7 @@ import com.plotsquared.core.util.ChatManager;
import com.plotsquared.core.util.ConsoleColors;
import com.plotsquared.core.util.EconHandler;
import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.FileUtils;
import com.plotsquared.core.util.PermHandler;
import com.plotsquared.core.util.PlatformWorldManager;
import com.plotsquared.core.util.PremiumVerification;
@ -420,8 +422,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final SQLiteUUIDService sqLiteUUIDService = new SQLiteUUIDService("user_cache.db");
final SQLiteUUIDService legacyUUIDService;
if (Settings.UUID.LEGACY_DATABASE_SUPPORT && MainUtil
.getFile(PlotSquared.platform().getDirectory(), "usercache.db").exists()) {
if (Settings.UUID.LEGACY_DATABASE_SUPPORT &&
FileUtils.getFile(PlotSquared.platform().getDirectory(), "usercache.db").exists()) {
legacyUUIDService = new SQLiteUUIDService("usercache.db");
} else {
legacyUUIDService = null;
@ -584,7 +586,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
}
final Plot plot = area.getOwnedPlot(id);
if (plot != null) {
if (!MainUtil.isServerOwned(plot) || PlotPlayer.wrap(plot.getOwner()) == null) {
if (!plot.getFlag(ServerPlotFlag.class) || PlotPlayer.wrap(plot.getOwner()) == null) {
if (world.getKeepSpawnInMemory()) {
world.setKeepSpawnInMemory(false);
return;
@ -1070,8 +1072,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
String manager = worldConfig.getString("generator.plugin", getPluginName());
PlotAreaBuilder builder = PlotAreaBuilder.newBuilder().plotManager(manager)
.generatorName(worldConfig.getString("generator.init", manager))
.plotAreaType(MainUtil.getType(worldConfig))
.terrainType(MainUtil.getTerrain(worldConfig))
.plotAreaType(ConfigurationUtil.getType(worldConfig))
.terrainType(ConfigurationUtil.getTerrain(worldConfig))
.settingsNodesWrapper(new SettingsNodesWrapper(new ConfigurationNode[0], null))
.worldName(worldName);
getInjector().getInstance(SetupUtils.class).setupWorld(builder);

View File

@ -36,7 +36,6 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.MainUtil;
import com.sk89q.worldedit.math.BlockVector2;
import lombok.Getter;
import org.bukkit.World;
@ -74,7 +73,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
this.populators = new ArrayList<>();
this.populators.add(new BlockStatePopulator(this.plotGenerator, this.plotAreaManager));
this.full = true;
MainUtil.initCache();
}
public BukkitPlotGenerator(final String world, final ChunkGenerator cg, @Nonnull final PlotAreaManager plotAreaManager) {
@ -87,7 +85,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
this.full = false;
this.platformGenerator = cg;
this.plotGenerator = new DelegatePlotGenerator(cg, world);
MainUtil.initCache();
}
@Override public void augment(PlotArea area) {

View File

@ -30,7 +30,7 @@ import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.PlayerManager;
import me.clip.placeholderapi.PlaceholderAPIPlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.Bukkit;
@ -122,7 +122,7 @@ public class Placeholders extends PlaceholderExpansion {
}
try {
return MainUtil.getName(plotOwner, false);
return PlayerManager.getName(plotOwner, false);
} catch (final Exception ignored) {}
final String name = Bukkit.getOfflinePlayer(plotOwner).getName();

View File

@ -31,7 +31,7 @@ import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.ChunkWrapper;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.ChunkUtil;
import com.plotsquared.core.util.PatternUtil;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.function.pattern.Pattern;
@ -158,12 +158,12 @@ public class GenChunk extends ScopedQueueCoordinator {
}
private void storeCache(final int x, final int y, final int z, final BlockState id) {
int i = MainUtil.CACHE_I[y][x][z];
int i = y >> 4;
BlockState[] v = this.result[i];
if (v == null) {
this.result[i] = v = new BlockState[4096];
}
int j = MainUtil.CACHE_J[y][x][z];
int j = ChunkUtil.getJ(x, y, z);
v[j] = id;
}
@ -178,7 +178,7 @@ public class GenChunk extends ScopedQueueCoordinator {
}
@Override public BlockState getBlock(int x, int y, int z) {
int i = MainUtil.CACHE_I[y][x][z];
int i = y >> 4;
if (result == null) {
return BukkitBlockUtil.get(chunkData.getType(x, y, z));
}
@ -186,7 +186,7 @@ public class GenChunk extends ScopedQueueCoordinator {
if (array == null) {
return BlockTypes.AIR.getDefaultState();
}
int j = MainUtil.CACHE_J[y][x][z];
int j = ChunkUtil.getJ(x, y, z);
return array[j];
}

View File

@ -40,7 +40,6 @@ import com.plotsquared.core.plot.PlotManager;
import com.plotsquared.core.queue.QueueCoordinator;
import com.plotsquared.core.queue.ScopedQueueCoordinator;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.RegionManager;
import com.plotsquared.core.util.RegionUtil;
import com.plotsquared.core.util.WorldUtil;

View File

@ -27,11 +27,11 @@ package com.plotsquared.bukkit.uuid;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.database.SQLite;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.FileUtils;
import com.plotsquared.core.uuid.UUIDMapping;
import com.plotsquared.core.uuid.UUIDService;
import javax.annotation.Nonnull;
import javax.annotation.Nonnull;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -51,7 +51,7 @@ public class SQLiteUUIDService implements UUIDService, Consumer<List<UUIDMapping
public SQLiteUUIDService(final String fileName) {
this.sqlite =
new SQLite(MainUtil.getFile(PlotSquared.platform().getDirectory(), fileName));
new SQLite(FileUtils.getFile(PlotSquared.platform().getDirectory(), fileName));
try {
this.sqlite.openConnection();
} catch (ClassNotFoundException | SQLException e) {