From bd7b377932ab98ccaf6da9cce600dd189f80e59a Mon Sep 17 00:00:00 2001 From: RadBuilder Date: Wed, 27 Dec 2017 16:00:24 -0800 Subject: [PATCH] Fixed placeholder apis --- .../radbuilder/emojichat/hooks/MVdWPlaceholderApiHook.java | 2 +- .../github/radbuilder/emojichat/hooks/PlaceholderApiHook.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/MVdWPlaceholderApiHook.java b/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/MVdWPlaceholderApiHook.java index 201582a..2af0e59 100644 --- a/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/MVdWPlaceholderApiHook.java +++ b/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/MVdWPlaceholderApiHook.java @@ -22,7 +22,7 @@ public class MVdWPlaceholderApiHook implements EmojiChatHook { */ public MVdWPlaceholderApiHook(EmojiChat plugin) { for (String key : plugin.getEmojiHandler().getEmojis().keySet()) { - PlaceholderAPI.registerStaticPlaceholders(plugin, key, plugin.getEmojiHandler().getEmojis().get(key).replace(":", "")); + PlaceholderAPI.registerStaticPlaceholders(plugin, key.replace(":", ""), plugin.getEmojiHandler().getEmojis().get(key)); } plugin.getLogger().info("Hooked " + getName()); diff --git a/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/PlaceholderApiHook.java b/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/PlaceholderApiHook.java index 4b92ddb..e40493f 100644 --- a/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/PlaceholderApiHook.java +++ b/plugin/src/main/java/io/github/radbuilder/emojichat/hooks/PlaceholderApiHook.java @@ -33,8 +33,8 @@ public PlaceholderApiHook(EmojiChat plugin) { public String onPlaceholderRequest(Player player, String identifier) { if (player != null && !player.hasPermission("emojichat.use")) // Make sure the player, if specified, has permission to use emojis return "No Permission"; - if (plugin.getEmojiHandler().getEmojis().containsKey(identifier)) { - return plugin.getEmojiHandler().getEmojis().get(identifier); + if (plugin.getEmojiHandler().getEmojis().containsKey(":" + identifier + ":")) { + return plugin.getEmojiHandler().getEmojis().get(":" + identifier + ":"); } return null; }