mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Repair / Salvage fixes
This commit is contained in:
parent
b0ce6fb170
commit
78eb367b86
@ -29,9 +29,13 @@ Version 2.1.131
|
|||||||
|
|
||||||
Added Red Nether Bricks to Experience tables for Mining in experience.yml (see notes)
|
Added Red Nether Bricks to Experience tables for Mining in experience.yml (see notes)
|
||||||
Added Netherite to Experience tables for Repair in experience.yml (see notes)
|
Added Netherite to Experience tables for Repair in experience.yml (see notes)
|
||||||
|
Changed Salvage maximum quantity values to 4 for all Netherite gear
|
||||||
|
|
||||||
|
Netherite now requires 100 Salvage skill (by default configs) in order to salvage
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
|
|
||||||
|
Repair and Salvage are going to get some tweaks regarding Netherite gear really soon.
|
||||||
This update adds quite a few missing entries for bonus drops, without these entries double drops on these items/blocks will not happen.
|
This update adds quite a few missing entries for bonus drops, without these entries double drops on these items/blocks will not happen.
|
||||||
You should not need to edit your configs to receive these changes.
|
You should not need to edit your configs to receive these changes.
|
||||||
|
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
package com.gmail.nossr50.config.skills.salvage;
|
package com.gmail.nossr50.config.skills.salvage;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.ConfigLoader;
|
import com.gmail.nossr50.config.ConfigLoader;
|
||||||
|
import com.gmail.nossr50.datatypes.database.UpgradeType;
|
||||||
import com.gmail.nossr50.datatypes.skills.ItemType;
|
import com.gmail.nossr50.datatypes.skills.ItemType;
|
||||||
import com.gmail.nossr50.datatypes.skills.MaterialType;
|
import com.gmail.nossr50.datatypes.skills.MaterialType;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory;
|
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableFactory;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
|
import com.gmail.nossr50.util.MaterialMapStore;
|
||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class SalvageConfig extends ConfigLoader {
|
public class SalvageConfig extends ConfigLoader {
|
||||||
@ -36,6 +39,24 @@ public class SalvageConfig extends ConfigLoader {
|
|||||||
ConfigurationSection section = config.getConfigurationSection("Salvageables");
|
ConfigurationSection section = config.getConfigurationSection("Salvageables");
|
||||||
Set<String> keys = section.getKeys(false);
|
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().info("Fixing incorrect Salvage quantities on Netherite gear, this will only run once...");
|
||||||
|
for(String namespacedkey : mcMMO.getMaterialMapStore().getNetheriteArmor()) {
|
||||||
|
config.set("Salvageables." + namespacedkey.toUpperCase() + ".MaximumQuantity", 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
config.save(getFile());
|
||||||
|
// mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.FIX_NETHERITE_SALVAGE_QUANTITIES);
|
||||||
|
mcMMO.p.getLogger().info("Fixed incorrect Salvage quantities for Netherite gear!");
|
||||||
|
} catch (IOException e) {
|
||||||
|
mcMMO.p.getLogger().info("Unable to fix Salvage config, please delete the salvage yml file to generate a new one.");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
// Validate all the things!
|
// Validate all the things!
|
||||||
List<String> reason = new ArrayList<String>();
|
List<String> reason = new ArrayList<String>();
|
||||||
@ -131,7 +152,7 @@ public class SalvageConfig extends ConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Maximum Quantity
|
// Maximum Quantity
|
||||||
int maximumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(itemMaterial, salvageMaterial) : config.getInt("Salvageables." + key + ".MaximumQuantity", 2));
|
int maximumQuantity = (itemMaterial != null ? SkillUtils.getRepairAndSalvageQuantities(itemMaterial, salvageMaterial) : config.getInt("Salvageables." + key + ".MaximumQuantity", 1));
|
||||||
|
|
||||||
if (maximumQuantity <= 0 && itemMaterial != null) {
|
if (maximumQuantity <= 0 && itemMaterial != null) {
|
||||||
maximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", 1);
|
maximumQuantity = config.getInt("Salvageables." + key + ".MaximumQuantity", 1);
|
||||||
|
@ -15,5 +15,6 @@ public enum UpgradeType {
|
|||||||
ADD_SKILL_TOTAL,
|
ADD_SKILL_TOTAL,
|
||||||
ADD_UNIQUE_PLAYER_DATA,
|
ADD_UNIQUE_PLAYER_DATA,
|
||||||
FIX_SPELLING_NETHERITE_SALVAGE,
|
FIX_SPELLING_NETHERITE_SALVAGE,
|
||||||
FIX_SPELLING_NETHERITE_REPAIR
|
FIX_SPELLING_NETHERITE_REPAIR,
|
||||||
|
FIX_NETHERITE_SALVAGE_QUANTITIES
|
||||||
}
|
}
|
||||||
|
@ -1088,6 +1088,15 @@ public class MaterialMapStore {
|
|||||||
toolBlackList.add("respawn_anchor");
|
toolBlackList.add("respawn_anchor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashSet<String> getNetheriteArmor() {
|
||||||
|
return netheriteArmor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashSet<String> getNetheriteTools() {
|
||||||
|
return netheriteTools;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getTier(Material material) {
|
public int getTier(Material material) {
|
||||||
return getTier(material.getKey().getKey());
|
return getTier(material.getKey().getKey());
|
||||||
}
|
}
|
||||||
|
@ -221,40 +221,40 @@ Salvageables:
|
|||||||
MaximumQuantity: 4
|
MaximumQuantity: 4
|
||||||
|
|
||||||
NETHERITE_SWORD:
|
NETHERITE_SWORD:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: .5
|
XpMultiplier: .5
|
||||||
MaximumQuantity: 2
|
MaximumQuantity: 4
|
||||||
NETHERITE_SHOVEL:
|
NETHERITE_SHOVEL:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: .3
|
XpMultiplier: .3
|
||||||
MaximumQuantity: 1
|
MaximumQuantity: 4
|
||||||
NETHERITE_PICKAXE:
|
NETHERITE_PICKAXE:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: 1
|
XpMultiplier: 1
|
||||||
MaximumQuantity: 3
|
MaximumQuantity: 4
|
||||||
NETHERITE_AXE:
|
NETHERITE_AXE:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: 1
|
XpMultiplier: 1
|
||||||
MaximumQuantity: 3
|
MaximumQuantity: 4
|
||||||
NETHERITE_HOE:
|
NETHERITE_HOE:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: .5
|
XpMultiplier: .5
|
||||||
MaximumQuantity: 2
|
MaximumQuantity: 4
|
||||||
# Armor
|
# Armor
|
||||||
NETHERITE_HELMET:
|
NETHERITE_HELMET:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: 6
|
XpMultiplier: 6
|
||||||
MaximumQuantity: 5
|
MaximumQuantity: 4
|
||||||
NETHERITE_CHESTPLATE:
|
NETHERITE_CHESTPLATE:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: 6
|
XpMultiplier: 6
|
||||||
MaximumQuantity: 8
|
MaximumQuantity: 4
|
||||||
NETHERITE_LEGGINGS:
|
NETHERITE_LEGGINGS:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: 6
|
XpMultiplier: 6
|
||||||
MaximumQuantity: 7
|
MaximumQuantity: 4
|
||||||
NETHERITE_BOOTS:
|
NETHERITE_BOOTS:
|
||||||
MinimumLevel: 50
|
MinimumLevel: 100
|
||||||
XpMultiplier: 6
|
XpMultiplier: 6
|
||||||
MaximumQuantity: 4
|
MaximumQuantity: 4
|
||||||
#
|
#
|
||||||
|
@ -9,3 +9,4 @@ Upgrades_Finished:
|
|||||||
ADD_ALCHEMY: false
|
ADD_ALCHEMY: false
|
||||||
FIX_SPELLING_NETHERITE_SALVAGE: false
|
FIX_SPELLING_NETHERITE_SALVAGE: false
|
||||||
FIX_SPELLING_NETHERITE_REPAIR: false
|
FIX_SPELLING_NETHERITE_REPAIR: false
|
||||||
|
FIX_NETHERITE_SALVAGE_QUANTITIES: false
|
||||||
|
Loading…
Reference in New Issue
Block a user