From b2b3baccf4a9bd8a4401684b248131cdf8b6e97f Mon Sep 17 00:00:00 2001 From: Mykyta Komarnytskyy Date: Tue, 10 Nov 2020 10:29:45 -0800 Subject: [PATCH] Remove 1.6.2 configuration version checker --- src/main/java/xyz/nkomarn/harbor/Harbor.java | 10 +----- .../harbor/listener/PlayerListener.java | 35 ------------------- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/main/java/xyz/nkomarn/harbor/listener/PlayerListener.java diff --git a/src/main/java/xyz/nkomarn/harbor/Harbor.java b/src/main/java/xyz/nkomarn/harbor/Harbor.java index 32dac06..64a1ede 100644 --- a/src/main/java/xyz/nkomarn/harbor/Harbor.java +++ b/src/main/java/xyz/nkomarn/harbor/Harbor.java @@ -2,15 +2,12 @@ import com.earth2me.essentials.Essentials; import org.bukkit.World; -import org.bukkit.boss.BossBar; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import xyz.nkomarn.harbor.command.ForceSkipCommand; import xyz.nkomarn.harbor.command.HarborCommand; import xyz.nkomarn.harbor.listener.BedListener; -import xyz.nkomarn.harbor.listener.PlayerListener; import xyz.nkomarn.harbor.task.Checker; import xyz.nkomarn.harbor.util.Config; import xyz.nkomarn.harbor.util.Messages; @@ -40,8 +37,7 @@ public void onEnable() { Arrays.asList( messages, playerManager, - new BedListener(this), - new PlayerListener(this) + new BedListener(this) ).forEach(listener -> pluginManager.registerEvents(listener, this)); getCommand("harbor").setExecutor(new HarborCommand(this)); @@ -55,10 +51,6 @@ public void onEnable() { if (config.getBoolean("metrics")) { new Metrics(this); } - - if (!config.getString("version").equals("1.6.2")) { - getLogger().warning("Your Harbor configuration is outdated- please regenerate your config or Harbor may not work properly!"); - } } @Override diff --git a/src/main/java/xyz/nkomarn/harbor/listener/PlayerListener.java b/src/main/java/xyz/nkomarn/harbor/listener/PlayerListener.java deleted file mode 100644 index af017ae..0000000 --- a/src/main/java/xyz/nkomarn/harbor/listener/PlayerListener.java +++ /dev/null @@ -1,35 +0,0 @@ -package xyz.nkomarn.harbor.listener; - -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerJoinEvent; -import org.jetbrains.annotations.NotNull; -import xyz.nkomarn.harbor.Harbor; -import xyz.nkomarn.harbor.util.Config; - -public class PlayerListener implements Listener { - - private final Harbor harbor; - - public PlayerListener(@NotNull Harbor harbor) { - this.harbor = harbor; - } - - @EventHandler - public void onJoin(PlayerJoinEvent event) { - Player player = event.getPlayer(); - - if (player.hasPermission("harbor.admin")) { - return; - } - - if (harbor.getConfiguration().getString("version").equals("1.6.2")) { - return; - } - - player.sendMessage(ChatColor.translateAlternateColorCodes('&', harbor.getConfiguration().getString("messages.miscellaneous.prefix") + - "Your Harbor configuration is outdated- please regenerate it or Harbor may not work properly.")); - } -}