Skip to content

Commit

Permalink
add-advancements-to-guide option
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertyuioplkjhgfd committed Oct 16, 2023
1 parent 661a326 commit e874b9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/me/char321/sfadvancements/SFAdvancements.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -70,7 +69,7 @@ public void onEnable() {
Bukkit.getPluginManager().registerEvents(guiManager, this);

// init sf
new AdvancementsItemGroup().register(this);
AdvancementsItemGroup.init(this);

// init core
DefaultCompleters.registerDefaultCompleters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

public class AdvancementsItemGroup extends FlexItemGroup {

public static void init(SFAdvancements plugin) {
if (SFAdvancements.getMainConfig().getConfiguration().getBoolean("add-advancements-to-guide")) {
new AdvancementsItemGroup().register(plugin);
}
}

public AdvancementsItemGroup() {
super(
new NamespacedKey(SFAdvancements.instance(), "advancements"),
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ auto-update: true
# adds your advancements to the vanilla advancements menu (experimental)
use-advancements-api: true
# whether to announce advancements
announce-advancements: true
announce-advancements: true
add-advancements-to-guide: true

0 comments on commit e874b9a

Please sign in to comment.