mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Move shit out of MainUtil into more appropriate classes
This commit is contained in:
@ -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;
|
||||
@ -99,7 +101,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;
|
||||
@ -408,8 +410,8 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
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;
|
||||
@ -569,7 +571,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
}
|
||||
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;
|
||||
@ -1049,8 +1051,8 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
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);
|
||||
|
@ -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();
|
||||
|
@ -38,9 +38,9 @@ import com.plotsquared.core.plot.PlotManager;
|
||||
import com.plotsquared.core.queue.LocalBlockQueue;
|
||||
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
|
||||
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;
|
||||
import com.plotsquared.core.util.entity.EntityCategories;
|
||||
import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
@ -484,7 +484,7 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
||||
@Override public void run(int[] value) {
|
||||
BlockVector2 loc = BlockVector2.at(value[0], value[1]);
|
||||
PlotSquared.platform().getChunkManager().loadChunk(world, loc, false).thenRun(() -> {
|
||||
MainUtil.setBiome(world, value[2], value[3], value[4], value[5], biome);
|
||||
WorldUtil.setBiome(world, value[2], value[3], value[4], value[5], biome);
|
||||
queue.refreshChunk(value[0], value[1]);
|
||||
});
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user