From 49595c641c49909895c737195ccc89d1d66546e1 Mon Sep 17 00:00:00 2001 From: Andre_601 <11576465+Andre601@users.noreply.github.com> Date: Thu, 30 Jul 2020 13:45:03 +0200 Subject: [PATCH] Update Hook-into-PlaceholderAPI.md --- wiki/Hook-into-PlaceholderAPI.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wiki/Hook-into-PlaceholderAPI.md b/wiki/Hook-into-PlaceholderAPI.md index afb0715..b05d047 100644 --- a/wiki/Hook-into-PlaceholderAPI.md +++ b/wiki/Hook-into-PlaceholderAPI.md @@ -116,13 +116,18 @@ public class JoinExample extends JavaPlugin implements Listener { */ Bukkit.getPluginManager().registerEvents(this, this); } else { - throw new RuntimeException("Could not find PlaceholderAPI!! Plugin can not work without it!"); + /* + * We inform about the fact that PlaceholderAPI isn't installed and then + * disable this plugin to prevent issues. + */ + getLogger().warn("Could not find PlaceholderAPI! This plugin is required."); + Bukkit.getPluginManager().disablePlugin(this); } } @EventHandler(priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent event) { - String joinText = "%player_name% &ajoined the server! He/she is rank &f%vault_rank%"; + String joinText = "%player_name% &ajoined the server! They are rank &f%vault_rank%"; /* * We parse the placeholders using "setPlaceholders" @@ -134,4 +139,4 @@ public class JoinExample extends JavaPlugin implements Listener { event.setJoinMessage(withPlaceholdersSet); } } -``` \ No newline at end of file +```