Slight optimization in PlaceholdersManager

This commit is contained in:
Florian CUNY 2018-11-10 11:04:10 +01:00
parent 571e734aa9
commit 3f62e2f367

View File

@ -25,10 +25,7 @@ public class PlaceholdersManager {
*/ */
public void registerPlaceholder(String placeholder, PlaceholderReplacer replacer) { public void registerPlaceholder(String placeholder, PlaceholderReplacer replacer) {
// Register it in PlaceholderAPI // Register it in PlaceholderAPI
plugin.getHooks().getHook("PlaceholderAPI").ifPresent(hook -> { plugin.getHooks().getHook("PlaceholderAPI").ifPresent(hook -> ((PlaceholderAPIHook) hook).registerBentoBoxPlaceholder(placeholder, replacer));
PlaceholderAPIHook placeholderAPIHook = (PlaceholderAPIHook) hook;
placeholderAPIHook.registerBentoBoxPlaceholder(placeholder, replacer);
});
} }
/** /**
@ -42,9 +39,6 @@ public class PlaceholdersManager {
return; return;
} }
// Register it in PlaceholderAPI // Register it in PlaceholderAPI
plugin.getHooks().getHook("PlaceholderAPI").ifPresent(hook -> { plugin.getHooks().getHook("PlaceholderAPI").ifPresent(hook -> ((PlaceholderAPIHook) hook).registerAddonPlaceholder(addon, placeholder, replacer));
PlaceholderAPIHook placeholderAPIHook = (PlaceholderAPIHook) hook;
placeholderAPIHook.registerAddonPlaceholder(addon, placeholder, replacer);
});
} }
} }