Added config option for auto discovery

This commit is contained in:
Auxilor
2021-01-07 19:16:09 +00:00
parent a35e4d0db7
commit 1d6a1fbf38
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package com.willfp.talismans.talismans.util;
import com.willfp.eco.util.config.Configs;
import com.willfp.talismans.talismans.Talisman;
import com.willfp.talismans.talismans.Talismans;
import org.bukkit.entity.Player;
@@ -18,6 +19,8 @@ public class DiscoverRecipeListener implements Listener {
public void onJoin(@NotNull final PlayerJoinEvent event) {
Player player = event.getPlayer();
Talismans.values().stream().filter(Talisman::isEnabled).map(Talisman::getKey).forEach(player::discoverRecipe);
if (Configs.CONFIG.getBool("crafting.discover")) {
Talismans.values().stream().filter(Talisman::isEnabled).map(Talisman::getKey).forEach(player::discoverRecipe);
}
}
}

View File

@@ -15,6 +15,9 @@ strengths:
relic:
color: "&d"
crafting:
discover: true # If players should automatically have recipes added to their crafting table.
read-enderchest: true # If a player's ender chest should be checked for talismans
read-shulkerboxes: true # If a player's shulker boxes should be checked for talismans