mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-04 05:25:28 +02:00
Add tridents/crossbows to salvage
This commit is contained in:
@@ -9,6 +9,7 @@ import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.LogUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -17,8 +18,6 @@ import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static com.gmail.nossr50.util.skills.SkillUtils.getRepairAndSalvageQuantities;
|
||||
|
||||
public class SalvageConfig extends BukkitConfig {
|
||||
private final HashSet<String> notSupported;
|
||||
private Set<Salvageable> salvageables;
|
||||
@@ -42,7 +41,6 @@ public class SalvageConfig extends BukkitConfig {
|
||||
Set<String> keys = section.getKeys(false);
|
||||
|
||||
//Original version of 1.16 support had maximum quantities that were bad, this fixes it
|
||||
|
||||
if (mcMMO.getUpgradeManager().shouldUpgrade(UpgradeType.FIX_NETHERITE_SALVAGE_QUANTITIES)) {
|
||||
mcMMO.p.getLogger().log(Level.INFO, "Fixing incorrect Salvage quantities on Netherite gear, this will only run once...");
|
||||
for (String namespacedkey : mcMMO.getMaterialMapStore().getNetheriteArmor()) {
|
||||
@@ -59,7 +57,6 @@ public class SalvageConfig extends BukkitConfig {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (String key : keys) {
|
||||
// Validate all the things!
|
||||
List<String> reason = new ArrayList<>();
|
||||
@@ -85,6 +82,8 @@ public class SalvageConfig extends BukkitConfig {
|
||||
salvageMaterialType = MaterialType.STONE;
|
||||
} else if (ItemUtils.isStringTool(salvageItem)) {
|
||||
salvageMaterialType = MaterialType.STRING;
|
||||
} else if (ItemUtils.isPrismarineTool(salvageItem)) {
|
||||
salvageMaterialType = MaterialType.PRISMARINE;
|
||||
} else if (ItemUtils.isLeatherArmor(salvageItem)) {
|
||||
salvageMaterialType = MaterialType.LEATHER;
|
||||
} else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) {
|
||||
@@ -145,7 +144,7 @@ public class SalvageConfig extends BukkitConfig {
|
||||
|
||||
// Maximum Quantity
|
||||
int maximumQuantity = itemMaterial != null
|
||||
? getRepairAndSalvageQuantities(itemMaterial, salvageMaterial)
|
||||
? SkillUtils.getRepairAndSalvageQuantities(itemMaterial, salvageMaterial)
|
||||
: config.getInt("Salvageables." + key + ".MaximumQuantity", 1);
|
||||
|
||||
if (maximumQuantity <= 0 && itemMaterial != null) {
|
||||
|
Reference in New Issue
Block a user