Manually resolve a bunch of merge issues

This commit is contained in:
Alexander Söderberg 2020-07-14 19:10:52 +02:00
parent 97fed21811
commit 0294397021
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
8 changed files with 29 additions and 57 deletions

View File

@ -59,8 +59,8 @@ import com.plotsquared.bukkit.uuid.SquirrelIdUUIDService;
import com.plotsquared.core.PlotPlatform; import com.plotsquared.core.PlotPlatform;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.backup.BackupManager; import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.backup.NullBackupManager; import com.plotsquared.core.command.WE_Anywhere;
import com.plotsquared.core.backup.SimpleBackupManager; import com.plotsquared.core.components.ComponentPresetManager;
import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ChatFormatter; import com.plotsquared.core.configuration.ChatFormatter;
import com.plotsquared.core.configuration.ConfigurationNode; import com.plotsquared.core.configuration.ConfigurationNode;
@ -79,7 +79,6 @@ import com.plotsquared.core.inject.annotations.WorldFile;
import com.plotsquared.core.inject.modules.PlotSquaredModule; import com.plotsquared.core.inject.modules.PlotSquaredModule;
import com.plotsquared.core.listener.PlotListener; import com.plotsquared.core.listener.PlotListener;
import com.plotsquared.core.listener.WESubscriber; import com.plotsquared.core.listener.WESubscriber;
import com.plotsquared.core.player.ConsolePlayer;
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.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
@ -95,7 +94,6 @@ import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.setup.PlotAreaBuilder; import com.plotsquared.core.setup.PlotAreaBuilder;
import com.plotsquared.core.setup.SettingsNodesWrapper; import com.plotsquared.core.setup.SettingsNodesWrapper;
import com.plotsquared.core.util.ChatManager; import com.plotsquared.core.util.ChatManager;
import com.plotsquared.core.util.ChunkManager;
import com.plotsquared.core.util.ConsoleColors; import com.plotsquared.core.util.ConsoleColors;
import com.plotsquared.core.util.EconHandler; import com.plotsquared.core.util.EconHandler;
import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.EventDispatcher;
@ -113,7 +111,6 @@ 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 lombok.Getter;
import org.bstats.bukkit.Metrics; import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -131,11 +128,11 @@ 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 org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
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.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.AbstractMap; import java.util.AbstractMap;
@ -161,7 +158,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
@SuppressWarnings("unused") public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPlatform<Player> { @SuppressWarnings("unused") public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPlatform<Player> {
private static final Logger logger = LoggerFactory.getLogger("P2/" + BukkitMain.class.getSimpleName()); private static final Logger logger = LoggerFactory.getLogger("P2/" + BukkitPlatform.class.getSimpleName());
private static final int BSTATS_ID = 1404; private static final int BSTATS_ID = 1404;
static { static {
@ -290,15 +287,13 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
// WorldEdit // WorldEdit
if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) { if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) {
try { try {
PlotSquared.log(Captions.PREFIX.getTranslated() + "&6" + this.getPluginName() logger.info("[P2] {} hooked into WorldEdit", this.getPluginName());
+ " hooked into WorldEdit.");
WorldEdit.getInstance().getEventBus().register(this.getInjector().getInstance(WESubscriber.class)); WorldEdit.getInstance().getEventBus().register(this.getInjector().getInstance(WESubscriber.class));
if (Settings.Enabled_Components.COMMANDS) { if (Settings.Enabled_Components.COMMANDS) {
new WE_Anywhere(); new WE_Anywhere();
} }
} catch (Throwable e) { } catch (Throwable e) {
PlotSquared.debug( logger.error("[P2] Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master");
"Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master");
} }
} }
@ -344,8 +339,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
try { try {
getInjector().getInstance(ComponentPresetManager.class); getInjector().getInstance(ComponentPresetManager.class);
} catch (final Exception e) { } catch (final Exception e) {
PlotSquared.log(Captions.PREFIX + "Failed to initialize the preset system"); logger.error("[P2] Failed to initialize the preset system", e);
e.printStackTrace();
} }
} }
@ -368,14 +362,11 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
continue; continue;
} }
if (!worldUtil.isWorld(world) && !world.equals("*")) { if (!worldUtil.isWorld(world) && !world.equals("*")) {
PlotSquared.debug("`" + world + "` was not properly loaded - " + this.getPluginName() logger.warn("[P2] `{}` was not properly loaded - {} will now try to load it properly",
+ " will now try to load it properly: "); world, this.getPluginName());
PlotSquared.debug( logger.warn("[P2] - Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml");
" - Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml"); logger.warn("[P2] - Your world management plugin may be faulty (or non existent)");
PlotSquared.debug( logger.warn("[P2] This message may also be a false positive and could be ignored.");
" - Your world management plugin may be faulty (or non existent)");
PlotSquared.debug(
" This message may also be a false positive and could be ignored.");
this.setGenerator(world); this.setGenerator(world);
} }
} }

View File

@ -27,26 +27,27 @@ package com.plotsquared.bukkit.inject;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
import com.google.inject.assistedinject.FactoryModuleBuilder; import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.backup.BackupManager; import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.backup.BackupProfile; import com.plotsquared.core.backup.BackupProfile;
import com.plotsquared.core.backup.NullBackupManager; import com.plotsquared.core.backup.NullBackupManager;
import com.plotsquared.core.backup.PlayerBackupProfile; import com.plotsquared.core.backup.PlayerBackupProfile;
import com.plotsquared.core.backup.SimpleBackupManager; import com.plotsquared.core.backup.SimpleBackupManager;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory; import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BackupModule extends AbstractModule { public class BackupModule extends AbstractModule {
private static final Logger logger = LoggerFactory.getLogger("P2/" + BackupModule.class.getSimpleName());
@Override protected void configure() { @Override protected void configure() {
try { try {
install(new FactoryModuleBuilder() install(new FactoryModuleBuilder()
.implement(BackupProfile.class, PlayerBackupProfile.class).build(PlayerBackupProfileFactory.class)); .implement(BackupProfile.class, PlayerBackupProfile.class).build(PlayerBackupProfileFactory.class));
bind(BackupManager.class).to(SimpleBackupManager.class); bind(BackupManager.class).to(SimpleBackupManager.class);
} catch (final Exception e) { } catch (final Exception e) {
PlotSquared.log(Captions.PREFIX + "&6Failed to initialize backup manager"); logger.error("[P2] Failed to initialize backup manager", e);
e.printStackTrace(); logger.error("[P2] Backup features will be disabled");
PlotSquared.log(Captions.PREFIX + "&6Backup features will be disabled");
bind(BackupManager.class).to(NullBackupManager.class); bind(BackupManager.class).to(NullBackupManager.class);
} }
} }

View File

@ -29,7 +29,6 @@ import com.google.inject.Inject;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import com.plotsquared.bukkit.BukkitPlatform; import com.plotsquared.bukkit.BukkitPlatform;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.bukkit.BukkitMain;
import com.plotsquared.core.generator.AugmentedUtils; import com.plotsquared.core.generator.AugmentedUtils;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.location.PlotLoc; import com.plotsquared.core.location.PlotLoc;
@ -58,10 +57,10 @@ import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
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.ArrayDeque; import java.util.ArrayDeque;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;

View File

@ -25,9 +25,6 @@
*/ */
package com.plotsquared.core; package com.plotsquared.core;
import com.plotsquared.core.configuration.Caption;
import com.plotsquared.core.command.WE_Anywhere;
import com.plotsquared.core.components.ComponentPresetManager;
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;
@ -48,7 +45,6 @@ import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory; import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
import com.plotsquared.core.listener.PlotListener; import com.plotsquared.core.listener.PlotListener;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.BlockBucket; import com.plotsquared.core.plot.BlockBucket;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
@ -67,20 +63,12 @@ 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.StringMan;
import com.plotsquared.core.util.logger.ILogger;
import com.plotsquared.core.util.WorldUtil;
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 lombok.Getter;
import lombok.Setter;
import javax.annotation.Nullable;
import lombok.NonNull;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -267,7 +255,6 @@ public class PlotSquared {
} }
public void startExpiryTasks() { public void startExpiryTasks() {
private void startExpiryTasks() {
if (Settings.Enabled_Components.PLOT_EXPIRY) { if (Settings.Enabled_Components.PLOT_EXPIRY) {
ExpireManager.IMP = new ExpireManager(this.eventDispatcher); ExpireManager.IMP = new ExpireManager(this.eventDispatcher);
ExpireManager.IMP.runAutomatedTask(); ExpireManager.IMP.runAutomatedTask();
@ -811,9 +798,9 @@ public class PlotSquared {
logger.info("[P2] - generator: {}>{}", baseGenerator, plotGenerator); logger.info("[P2] - generator: {}>{}", baseGenerator, plotGenerator);
logger.info("[P2] - plot world: {}", plotArea.getClass().getCanonicalName()); logger.info("[P2] - plot world: {}", plotArea.getClass().getCanonicalName());
logger.info("[P2] - plot area manager: {}", plotManager.getClass().getCanonicalName()); logger.info("[P2] - plot area manager: {}", plotManager.getClass().getCanonicalName());
if (!this.worlds.contains(path)) { if (!this.worldConfiguration.contains(path)) {
this.worlds.createSection(path); this.worldConfiguration.createSection(path);
worldSection = this.worlds.getConfigurationSection(path); worldSection = this.worldConfiguration.getConfigurationSection(path);
} }
plotArea.saveConfiguration(worldSection); plotArea.saveConfiguration(worldSection);
plotArea.loadDefaultConfiguration(worldSection); plotArea.loadDefaultConfiguration(worldSection);
@ -1264,8 +1251,8 @@ public class PlotSquared {
e.printStackTrace(); e.printStackTrace();
logger.error("[P2] &d==== End of stacktrace ===="); logger.error("[P2] &d==== End of stacktrace ====");
logger.error("[P2] &6Please go to the {} 'storage.yml' and configure the database correctly", logger.error("[P2] &6Please go to the {} 'storage.yml' and configure the database correctly",
imp().getPluginName()); platform.getPluginName());
this.IMP.shutdown(); //shutdown used instead of disable because of database error this.platform.shutdown(); //shutdown used instead of disable because of database error
} }
} }
@ -1399,11 +1386,6 @@ public class PlotSquared {
} catch (IOException ignored) { } catch (IOException ignored) {
logger.error("[P2] Failed to save storage.yml"); logger.error("[P2] Failed to save storage.yml");
} }
try {
this.style.save(this.styleFile);
} catch (IOException e) {
logger.error("[P2] Configuration file saving failed", e);
}
return true; return true;
} }

View File

@ -63,7 +63,6 @@ import java.util.Set;
public class Trim extends SubCommand { public class Trim extends SubCommand {
private static final Logger logger = LoggerFactory.getLogger("P2/" + Trim.class.getSimpleName()); private static final Logger logger = LoggerFactory.getLogger("P2/" + Trim.class.getSimpleName());
public static ArrayList<Plot> expired = null;
private static volatile boolean TASK = false; private static volatile boolean TASK = false;
private final PlotAreaManager plotAreaManager; private final PlotAreaManager plotAreaManager;

View File

@ -29,8 +29,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Setter; import lombok.Setter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;

View File

@ -42,7 +42,8 @@ public class PlotMessage {
try { try {
reset(ChatManager.manager); reset(ChatManager.manager);
} catch (Throwable e) { } catch (Throwable e) {
logger.error("[P2] {} doesn't support fancy chat for {}", PlotSquared.imp().getPluginName(), PlotSquared.get().IMP.getServerVersion()); logger.error("[P2] {} doesn't support fancy chat for {}", PlotSquared.platform().getPluginName(),
PlotSquared.platform().getServerVersion());
ChatManager.manager = new PlainChatManager(); ChatManager.manager = new PlainChatManager();
reset(ChatManager.manager); reset(ChatManager.manager);
} }

View File

@ -25,16 +25,17 @@
*/ */
package com.plotsquared.core.util; package com.plotsquared.core.util;
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.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.plot.BlockBucket; import com.plotsquared.core.plot.BlockBucket;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
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.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;