mirror of
				https://github.com/PlaceholderAPI/PlaceholderAPI
				synced 2025-10-31 06:12:28 +01:00 
			
		
		
		
	removed obsolete EZPlaceholderHook
This commit is contained in:
		| @@ -26,7 +26,6 @@ import me.clip.placeholderapi.expansion.ExpansionManager; | |||||||
| import me.clip.placeholderapi.expansion.PlaceholderExpansion; | import me.clip.placeholderapi.expansion.PlaceholderExpansion; | ||||||
| import me.clip.placeholderapi.expansion.Version; | import me.clip.placeholderapi.expansion.Version; | ||||||
| import me.clip.placeholderapi.expansion.cloud.ExpansionCloudManager; | import me.clip.placeholderapi.expansion.cloud.ExpansionCloudManager; | ||||||
| import me.clip.placeholderapi.external.EZPlaceholderHook; |  | ||||||
| import me.clip.placeholderapi.listeners.PlaceholderListener; | import me.clip.placeholderapi.listeners.PlaceholderListener; | ||||||
| import me.clip.placeholderapi.listeners.ServerLoadEventListener; | import me.clip.placeholderapi.listeners.ServerLoadEventListener; | ||||||
| import me.clip.placeholderapi.updatechecker.UpdateChecker; | import me.clip.placeholderapi.updatechecker.UpdateChecker; | ||||||
| @@ -36,7 +35,6 @@ import org.bukkit.Bukkit; | |||||||
| import org.bukkit.command.CommandSender; | import org.bukkit.command.CommandSender; | ||||||
| import org.bukkit.command.PluginCommand; | import org.bukkit.command.PluginCommand; | ||||||
| import org.bukkit.event.HandlerList; | import org.bukkit.event.HandlerList; | ||||||
| import org.bukkit.plugin.Plugin; |  | ||||||
| import org.bukkit.plugin.java.JavaPlugin; | import org.bukkit.plugin.java.JavaPlugin; | ||||||
| import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.NotNull; | ||||||
|  |  | ||||||
| @@ -94,8 +92,6 @@ public final class PlaceholderAPIPlugin extends JavaPlugin | |||||||
| 		{ | 		{ | ||||||
| 			new UpdateChecker(this).fetch(); | 			new UpdateChecker(this).fetch(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		getServer().getScheduler().runTaskLater(this, this::serveWarning, 40); |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	@Override | 	@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() | 	private void setupExpansions() | ||||||
| 	{ | 	{ | ||||||
| 		try | 		try | ||||||
|   | |||||||
| @@ -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 <http://www.gnu.org/licenses/>. |  | ||||||
|  * |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| 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; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
		Reference in New Issue
	
	Block a user