Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
CustomAdvancement: add switch visible type advancement
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Aug 8, 2023
1 parent 4dd393d commit 4cca8eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public void onPlayerAdvancementDone(PlayerAdvancementDoneEvent event) {
FAdvancement fAdvancement = new FAdvancement(event.getAdvancement());
FAdvancementType fAdvancementType = fAdvancement.getType();

if (fAdvancementType == FAdvancementType.UNKNOWN || fAdvancement.isHidden() || !fAdvancement.announceToChat())
if (fAdvancementType == FAdvancementType.UNKNOWN
|| fAdvancement.isHidden()
|| !fAdvancement.announceToChat()
|| !Main.config.getBoolean("advancement.message." + fAdvancementType + ".visible"))
return;

String formatMessage = Main.locale.getString("advancement." + fAdvancementType + ".name");
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ advancement:
message:
enable: true

task:
visible: true
goal:
visible: true
challenge:
visible: true


player:
display-name: "<world_prefix><vault_prefix><stream_prefix><player><afk_suffix><vault_suffix>"
tab-name: "<world_prefix><vault_prefix><stream_prefix><player><afk_suffix><vault_suffix>"
Expand Down

0 comments on commit 4cca8eb

Please sign in to comment.