forked from mirror/PlaceholderAPI
Update Hook-into-PlaceholderAPI.md
This commit is contained in:
parent
98fbceeb1d
commit
49595c641c
@ -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);
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user