Updating wiki from commit 21583ebad0
parent
31cfd5c15b
commit
f0dab8529f
|
@ -35,12 +35,12 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
|||
* This class will automatically register as a placeholder expansion
|
||||
* when a jar including this class is added to the directory
|
||||
* {@code /plugins/PlaceholderAPI/expansions} on your server.
|
||||
* <br>
|
||||
* <br>If you create such a class inside your own plugin, you have to
|
||||
*
|
||||
* <p>If you create such a class inside your own plugin, you have to
|
||||
* register it manually in your plugins {@code onEnable()} by using
|
||||
* {@code new YourExpansionClass().register();}
|
||||
*/
|
||||
public final class SomeExpansion extends PlaceholderExpansion {
|
||||
public class SomeExpansion extends PlaceholderExpansion {
|
||||
|
||||
/**
|
||||
* This method should always return true unless we
|
||||
|
@ -92,6 +92,8 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
/**
|
||||
* This is the method called when a placeholder with our identifier
|
||||
* is found and needs a value.
|
||||
* <br>We specify the value identifier in this method.
|
||||
* <br>Since version 2.9.1 can you use OfflinePlayers in your requests (recommended).
|
||||
*
|
||||
* @param player
|
||||
* A {@link org.bukkit.OfflinePlayer OfflinePlayer}.
|
||||
|
@ -144,12 +146,12 @@ import at.helpch.placeholderapi.example.SomePlugin;
|
|||
* This class will automatically register as a placeholder expansion
|
||||
* when a jar including this class is added to the directory
|
||||
* {@code /plugins/PlaceholderAPI/expansions} on your server.
|
||||
* <br>
|
||||
* <br>If you create such a class inside your own plugin, you have to
|
||||
* register it manually in your plugins {@code onEnable()} by using
|
||||
*
|
||||
* <p>If you create such a class inside your own plugin, you have to
|
||||
* register it manually in your plugins {@code onEbale()} by using
|
||||
* {@code new YourExpansionClass().register();}
|
||||
*/
|
||||
public final class SomeExpansion extends PlaceholderExpansion {
|
||||
public class SomeExpansion extends PlaceholderExpansion {
|
||||
|
||||
// We get an instance of the plugin later.
|
||||
private SomePlugin plugin;
|
||||
|
@ -158,7 +160,7 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
* Since this expansion requires api access to the plugin "SomePlugin"
|
||||
* we must check if said plugin is on the server or not.
|
||||
*
|
||||
* @return true or false depending on if the required plugin is installed.
|
||||
* @return wether the required plugin is installed.
|
||||
*/
|
||||
@Override
|
||||
public boolean canRegister(){
|
||||
|
@ -194,8 +196,8 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
* proper name of the dependency should go here.
|
||||
* <br>Set this to {@code null} if your placeholders do not require
|
||||
* another plugin to be installed on the server for them to work.
|
||||
* <br>
|
||||
* <br>This is extremely important to set your plugin here, since if
|
||||
*
|
||||
* <p>This is extremely important to set your plugin here, since if
|
||||
* you don't do it, your expansion will throw errors.
|
||||
*
|
||||
* @return The name of our dependency.
|
||||
|
@ -219,9 +221,11 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
/**
|
||||
* This is the method called when a placeholder with our identifier
|
||||
* is found and needs a value.
|
||||
* <br>We specify the value identifier in this method.
|
||||
* <br>Since version 2.9.1 can you use OfflinePlayers in your requests (recommended).
|
||||
*
|
||||
* @param player
|
||||
* A {@link org.bukkit.OfflinePlayer OfflinePlayer}.
|
||||
* A {@link org.bukkit.Player Player}.
|
||||
* @param identifier
|
||||
* A String containing the identifier/value.
|
||||
*
|
||||
|
@ -230,7 +234,7 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
@Override
|
||||
public String onRequest(OfflinePlayer player, String identifier){
|
||||
|
||||
if(player == null){
|
||||
if(p == null){
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -270,7 +274,7 @@ import at.helpch.placeholderapi.example.SomePlugin;
|
|||
* This class will be registered through the register-method in the
|
||||
* plugins onEnable-method.
|
||||
*/
|
||||
public final class SomeExpansion extends PlaceholderExpansion {
|
||||
public class SomeExpansion extends PlaceholderExpansion {
|
||||
|
||||
private SomePlugin plugin;
|
||||
|
||||
|
@ -311,7 +315,7 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
|
||||
/**
|
||||
* The name of the person who created this expansion should go here.
|
||||
* <br>For convienience do we return the author from the plugin.yml
|
||||
* <br>For convienience do we return the authors from the plugin.yml
|
||||
*
|
||||
* @return The name of the author as a String.
|
||||
*/
|
||||
|
@ -350,16 +354,18 @@ public final class SomeExpansion extends PlaceholderExpansion {
|
|||
/**
|
||||
* This is the method called when a placeholder with our identifier
|
||||
* is found and needs a value.
|
||||
* <br>We specify the value identifier in this method.
|
||||
* <br>Since version 2.9.1 can you use OfflinePlayers in your requests (recommended).
|
||||
*
|
||||
* @param player
|
||||
* A {@link org.bukkit.OfflinePlayer OfflinePlayer}.
|
||||
* A {@link org.bukkit.Player Player}.
|
||||
* @param identifier
|
||||
* A String containing the identifier/value.
|
||||
*
|
||||
* @return possibly-null String of the requested identifier.
|
||||
*/
|
||||
@Override
|
||||
public String onRequest(OfflinePlayer player, String identifier){
|
||||
public String onRequest(Player player, String identifier){
|
||||
|
||||
if(player == null){
|
||||
return "";
|
||||
|
@ -402,4 +408,4 @@ public class SomePlugin extends JavaPlugin{
|
|||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue