Implements some necessary code for the scrapper
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

Implements ignored salvage
Implements salvage-able items
Adds some TODOs
Implements salvage fail chance
Moves several methods to ItemHelper
Adds option for allowing extended salvage
This commit is contained in:
2023-12-30 13:56:33 +01:00
parent 6872dadca8
commit dfae68050e
13 changed files with 482 additions and 165 deletions

View File

@@ -19,6 +19,8 @@ import org.bukkit.enchantments.Enchantment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
/**
* The command used for changing global blacksmith configuration options
*/
@@ -213,12 +215,8 @@ public class BlackSmithConfigCommand implements CommandExecutor {
private void updateAllMatchedPrices(@NotNull GlobalBlacksmithSettings settings,
@NotNull BlacksmithSetting blacksmithSetting,
@NotNull String materialName, double newPrice) {
String search = InputParsingHelper.regExIfy(materialName);
for (Material material : ItemHelper.getAllReforgeAbleMaterials()) {
if (!material.name().matches(search)) {
continue;
}
List<Material> materials = ItemHelper.getWildcardMatch(materialName);
for (Material material : materials) {
if (blacksmithSetting == BlacksmithSetting.BASE_PRICE) {
settings.setBasePrice(material, newPrice);
} else {