2022-04-16 12:32:22 +00:00
|
|
|
// This claas was created by JaTiTV
|
|
|
|
|
|
|
|
package de.jatitv.commandguiv2.Spigot.system;
|
|
|
|
|
|
|
|
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
|
|
|
import de.jatitv.commandguiv2.Spigot.Main;
|
|
|
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
|
|
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
public class Placeholder extends PlaceholderExpansion {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getIdentifier() {
|
|
|
|
return "commandgui";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getAuthor() {
|
|
|
|
return Main.plugin.getDescription().getAuthors().toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getVersion() {
|
|
|
|
return Main.plugin.getDescription().getVersion();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canRegister() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean persist() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String onPlaceholderRequest(Player p, String params) {
|
|
|
|
if (params.contains("useitem_boolean")) {
|
2022-05-16 12:03:53 +00:00
|
|
|
return Events.useItemHashMap.get(p.getName()).toString();
|
2022-04-16 12:32:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (params.contains("useitem")) {
|
2022-05-16 12:03:53 +00:00
|
|
|
if (Events.useItemHashMap.get(p.getName())) {
|
2022-04-16 12:32:22 +00:00
|
|
|
return SelectConfig.placeholderTrue;
|
|
|
|
} else return SelectConfig.placeholderFalse;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (params.contains("slot")){
|
2022-05-16 12:03:53 +00:00
|
|
|
return Events.useItemSlotHashMap.get(p.getName()).toString();
|
2022-04-16 12:32:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|