From 6fade3fb93cd7efaf77373cd2c894fd618a20f66 Mon Sep 17 00:00:00 2001 From: Sxtanna Date: Fri, 24 Jul 2020 01:39:17 -0400 Subject: [PATCH] removed obsolete EZPlaceholderHook --- .../placeholderapi/PlaceholderAPIPlugin.java | 26 -------- .../external/EZPlaceholderHook.java | 59 ------------------- 2 files changed, 85 deletions(-) delete mode 100644 src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java b/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java index db2e2ed..fd9e9f4 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java @@ -26,7 +26,6 @@ import me.clip.placeholderapi.expansion.ExpansionManager; import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.Version; import me.clip.placeholderapi.expansion.cloud.ExpansionCloudManager; -import me.clip.placeholderapi.external.EZPlaceholderHook; import me.clip.placeholderapi.listeners.PlaceholderListener; import me.clip.placeholderapi.listeners.ServerLoadEventListener; import me.clip.placeholderapi.updatechecker.UpdateChecker; @@ -36,7 +35,6 @@ import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.event.HandlerList; -import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.NotNull; @@ -94,8 +92,6 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { new UpdateChecker(this).fetch(); } - - getServer().getScheduler().runTaskLater(this, this::serveWarning, 40); } @Override @@ -211,28 +207,6 @@ public final class PlaceholderAPIPlugin extends JavaPlugin })); } - private void serveWarning() - { - for (final PlaceholderHook hook : PlaceholderAPI.getPlaceholders().values()) - { - if (!(hook instanceof EZPlaceholderHook)) - { - continue; - } - - final EZPlaceholderHook legacy = (EZPlaceholderHook) hook; - final Plugin plugin = Bukkit.getPluginManager().getPlugin(legacy.getPluginName()); - - - getLogger().severe(String.format("%s is using a legacy PlaceholderAPI hook, these placeholders will no longer work.\nPlease consult %s and urge them to update it ASAP.", - legacy.getPluginName(), - plugin == null ? "the author of the hook's plugin" : plugin.getDescription().getAuthors().toString())); - - // disable the hook on startup - PlaceholderAPI.unregisterPlaceholderHook(legacy.getPlaceholderName()); - } - } - private void setupExpansions() { try diff --git a/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java b/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java deleted file mode 100644 index a51893d..0000000 --- a/src/main/java/me/clip/placeholderapi/external/EZPlaceholderHook.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * PlaceholderAPI - * Copyright (C) 2019 Ryan McCarthy - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * - */ -package me.clip.placeholderapi.external; - -import me.clip.placeholderapi.PlaceholderAPI; -import me.clip.placeholderapi.PlaceholderHook; -import org.apache.commons.lang.Validate; -import org.bukkit.plugin.Plugin; - -/** - * Use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} instead - */ -@Deprecated -public abstract class EZPlaceholderHook extends PlaceholderHook { - - private final String identifier; - private final String plugin; - - public EZPlaceholderHook(Plugin plugin, String identifier) { - Validate.notNull(plugin, "Plugin can not be null!"); - Validate.notNull(identifier, "Placeholder name can not be null!"); - this.identifier = identifier; - this.plugin = plugin.getName(); - } - - public boolean isHooked() { - return PlaceholderAPI.getRegisteredPlaceholderPlugins().contains(identifier); - } - - public boolean hook() { - return PlaceholderAPI.registerPlaceholderHook(identifier, this); - } - - public String getPlaceholderName() { - return identifier; - } - - public String getPluginName() { - return plugin; - } -}