Skip to content

Commit c07e4b3

Browse files
committed
fix: surface requirement feedback when accepting a quest via GUI/NPC/armor stand
1 parent beda6c4 commit c07e4b3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

paper/src/main/java/rocks/gravili/notquests/paper/structs/actions/GiveQuestAction.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,15 @@ public void executeInternally(final QuestPlayer questPlayer, Object... objects)
9292
return;
9393
}
9494
if (!isForceGive()) {
95-
main.getQuestPlayerManager().acceptQuest(questPlayer, foundQuest, true, true);
95+
// acceptQuest sends the formatted success message/title itself and returns the "accepted"
96+
// sentinel on success, or a feedback message (e.g. "requirements not fulfilled") on failure.
97+
// Forward only the failure message so accepting via a GUI / NPC / armor stand gives the same
98+
// feedback as /q take, instead of silently closing the GUI with no indication.
99+
final String result = main.getQuestPlayerManager().acceptQuest(questPlayer, foundQuest, true, true);
100+
final var player = questPlayer.getPlayer();
101+
if (player != null && result != null && !result.equals("accepted")) {
102+
main.sendMessage(player, result);
103+
}
96104
} else {
97105
main.getQuestPlayerManager().forceAcceptQuestSilent(questPlayer.getUniqueId(), foundQuest);
98106
}

0 commit comments

Comments
 (0)