mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-15 07:05:51 +01:00
Support PlaceholderAPI in command rewards, untested. Fixes #878
This commit is contained in:
parent
61c2f92f18
commit
c4bffc9f5d
@ -46,6 +46,7 @@ import me.blackvein.quests.events.quester.QuesterPreFailQuestEvent;
|
||||
import me.blackvein.quests.exceptions.InvalidStageException;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
|
||||
public class Quest {
|
||||
@ -450,7 +451,11 @@ public class Quest {
|
||||
none = null;
|
||||
}
|
||||
for (String s : rews.getCommands()) {
|
||||
final String command = s.replace("<player>", player.getName());
|
||||
String temp = s.replace("<player>", player.getName());
|
||||
if (plugin.getDependencies().getPlaceholderApi() != null) {
|
||||
temp = PlaceholderAPI.setPlaceholders(player, temp);
|
||||
}
|
||||
final String command = temp;
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
Bukkit.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), command);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user