mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-28 19:21:35 +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.exceptions.InvalidStageException;
|
||||||
import me.blackvein.quests.util.ItemUtil;
|
import me.blackvein.quests.util.ItemUtil;
|
||||||
import me.blackvein.quests.util.Lang;
|
import me.blackvein.quests.util.Lang;
|
||||||
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
|
|
||||||
public class Quest {
|
public class Quest {
|
||||||
@ -450,7 +451,11 @@ public class Quest {
|
|||||||
none = null;
|
none = null;
|
||||||
}
|
}
|
||||||
for (String s : rews.getCommands()) {
|
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()) {
|
if (Bukkit.isPrimaryThread()) {
|
||||||
Bukkit.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), command);
|
Bukkit.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), command);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user