mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
2.1.120
This commit is contained in:
@ -75,8 +75,8 @@ public class SalvageConfig extends ConfigLoader {
|
||||
}
|
||||
else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) {
|
||||
salvageMaterialType = MaterialType.DIAMOND;
|
||||
} else if (ItemUtils.isNetherriteTool(salvageItem) || ItemUtils.isNetherriteArmor(salvageItem)) {
|
||||
salvageMaterialType = MaterialType.NETHERRACK;
|
||||
} else if (ItemUtils.isNetheriteTool(salvageItem) || ItemUtils.isNetheriteArmor(salvageItem)) {
|
||||
salvageMaterialType = MaterialType.NETHER;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -10,7 +10,7 @@ public enum MaterialType {
|
||||
IRON,
|
||||
GOLD,
|
||||
DIAMOND,
|
||||
NETHERRACK,
|
||||
NETHER,
|
||||
OTHER;
|
||||
|
||||
public Material getDefaultMaterial() {
|
||||
@ -36,9 +36,9 @@ public enum MaterialType {
|
||||
case DIAMOND:
|
||||
return Material.DIAMOND;
|
||||
|
||||
case NETHERRACK:
|
||||
if(Material.getMaterial("netherrite_scrap") != null)
|
||||
return Material.getMaterial("netherrite_scrap");
|
||||
case NETHER:
|
||||
if(Material.getMaterial("netherite_scrap") != null)
|
||||
return Material.getMaterial("netherite_scrap");
|
||||
else
|
||||
return Material.GOLD_INGOT;
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class SwordsManager extends SkillManager {
|
||||
|
||||
public int getToolTier(ItemStack itemStack)
|
||||
{
|
||||
if(ItemUtils.isNetherriteTool(itemStack))
|
||||
if(ItemUtils.isNetheriteTool(itemStack))
|
||||
return 5;
|
||||
if(ItemUtils.isDiamondTool(itemStack))
|
||||
return 4;
|
||||
|
@ -143,12 +143,12 @@ public final class ItemUtils {
|
||||
return mcMMO.getMaterialMapStore().isDiamondArmor(item.getType().getKey().getKey());
|
||||
}
|
||||
|
||||
public static boolean isNetherriteArmor(ItemStack itemStack) {
|
||||
return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType().getKey().getKey());
|
||||
public static boolean isNetheriteArmor(ItemStack itemStack) {
|
||||
return mcMMO.getMaterialMapStore().isNetheriteArmor(itemStack.getType().getKey().getKey());
|
||||
}
|
||||
|
||||
public static boolean isNetherriteTool(ItemStack itemStack) {
|
||||
return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType().getKey().getKey());
|
||||
public static boolean isNetheriteTool(ItemStack itemStack) {
|
||||
return mcMMO.getMaterialMapStore().isNetheriteTool(itemStack.getType().getKey().getKey());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,8 +26,8 @@ public class MaterialMapStore {
|
||||
private HashSet<String> foodItemWhiteList;
|
||||
private HashSet<String> glassBlocks;
|
||||
|
||||
private HashSet<String> netherriteArmor;
|
||||
private HashSet<String> netherriteTools;
|
||||
private HashSet<String> netheriteArmor;
|
||||
private HashSet<String> netheriteTools;
|
||||
private HashSet<String> woodTools;
|
||||
private HashSet<String> stoneTools;
|
||||
private HashSet<String> leatherArmor;
|
||||
@ -75,7 +75,7 @@ public class MaterialMapStore {
|
||||
chainmailArmor = new HashSet<>();
|
||||
goldArmor = new HashSet<>();
|
||||
diamondArmor = new HashSet<>();
|
||||
netherriteArmor = new HashSet<>();
|
||||
netheriteArmor = new HashSet<>();
|
||||
armors = new HashSet<>();
|
||||
|
||||
woodTools = new HashSet<>();
|
||||
@ -83,7 +83,7 @@ public class MaterialMapStore {
|
||||
ironTools = new HashSet<>();
|
||||
goldTools = new HashSet<>();
|
||||
diamondTools = new HashSet<>();
|
||||
netherriteTools = new HashSet<>();
|
||||
netheriteTools = new HashSet<>();
|
||||
bows = new HashSet<>();
|
||||
stringTools = new HashSet<>();
|
||||
tools = new HashSet<>();
|
||||
@ -185,7 +185,7 @@ public class MaterialMapStore {
|
||||
tierValue.put(id, 6);
|
||||
}
|
||||
|
||||
for(String id : netherriteArmor) {
|
||||
for(String id : netheriteArmor) {
|
||||
tierValue.put(id, 12);
|
||||
}
|
||||
}
|
||||
@ -209,7 +209,7 @@ public class MaterialMapStore {
|
||||
fillChainmailWhiteList();
|
||||
fillGoldArmorWhiteList();
|
||||
fillDiamondArmorWhiteList();
|
||||
fillNetherriteArmorWhiteList();
|
||||
fillnetheriteArmorWhiteList();
|
||||
|
||||
//Add all armors to armors hashset
|
||||
armors.addAll(leatherArmor);
|
||||
@ -217,7 +217,7 @@ public class MaterialMapStore {
|
||||
armors.addAll(chainmailArmor);
|
||||
armors.addAll(goldArmor);
|
||||
armors.addAll(diamondArmor);
|
||||
armors.addAll(netherriteArmor);
|
||||
armors.addAll(netheriteArmor);
|
||||
|
||||
armors.add("turtle_shell");
|
||||
}
|
||||
@ -245,7 +245,7 @@ public class MaterialMapStore {
|
||||
fillIronToolsWhiteList();
|
||||
fillGoldToolsWhiteList();
|
||||
fillDiamondToolsWhiteList();
|
||||
fillNetherriteToolsWhiteList();
|
||||
fillnetheriteToolsWhiteList();
|
||||
|
||||
fillSwords();
|
||||
fillAxes();
|
||||
@ -262,7 +262,7 @@ public class MaterialMapStore {
|
||||
tools.addAll(ironTools);
|
||||
tools.addAll(goldTools);
|
||||
tools.addAll(diamondTools);
|
||||
tools.addAll(netherriteTools);
|
||||
tools.addAll(netheriteTools);
|
||||
tools.addAll(tridents);
|
||||
tools.addAll(stringTools);
|
||||
tools.addAll(bows);
|
||||
@ -290,7 +290,7 @@ public class MaterialMapStore {
|
||||
swords.add("gold_sword");
|
||||
swords.add("golden_sword");
|
||||
swords.add("diamond_sword");
|
||||
swords.add("netherrite_sword");
|
||||
swords.add("netherite_sword");
|
||||
}
|
||||
|
||||
private void fillAxes() {
|
||||
@ -301,7 +301,7 @@ public class MaterialMapStore {
|
||||
axes.add("gold_axe");
|
||||
axes.add("golden_axe");
|
||||
axes.add("diamond_axe");
|
||||
axes.add("netherrite_axe");
|
||||
axes.add("netherite_axe");
|
||||
}
|
||||
|
||||
private void fillPickAxes() {
|
||||
@ -312,7 +312,7 @@ public class MaterialMapStore {
|
||||
pickAxes.add("gold_pickaxe");
|
||||
pickAxes.add("golden_pickaxe");
|
||||
pickAxes.add("diamond_pickaxe");
|
||||
pickAxes.add("netherrite_pickaxe");
|
||||
pickAxes.add("netherite_pickaxe");
|
||||
}
|
||||
|
||||
private void fillHoes() {
|
||||
@ -323,7 +323,7 @@ public class MaterialMapStore {
|
||||
hoes.add("gold_hoe");
|
||||
hoes.add("golden_hoe");
|
||||
hoes.add("diamond_hoe");
|
||||
hoes.add("netherrite_hoe");
|
||||
hoes.add("netherite_hoe");
|
||||
}
|
||||
|
||||
private void fillShovels() {
|
||||
@ -334,7 +334,7 @@ public class MaterialMapStore {
|
||||
shovels.add("gold_shovel");
|
||||
shovels.add("golden_shovel");
|
||||
shovels.add("diamond_shovel");
|
||||
shovels.add("netherrite_shovel");
|
||||
shovels.add("netherite_shovel");
|
||||
}
|
||||
|
||||
private void fillLeatherArmorWhiteList() {
|
||||
@ -378,11 +378,11 @@ public class MaterialMapStore {
|
||||
diamondArmor.add("diamond_boots");
|
||||
}
|
||||
|
||||
private void fillNetherriteArmorWhiteList() {
|
||||
netherriteArmor.add("netherrite_helmet");
|
||||
netherriteArmor.add("netherrite_chestplate");
|
||||
netherriteArmor.add("netherrite_leggings");
|
||||
netherriteArmor.add("netherrite_boots");
|
||||
private void fillnetheriteArmorWhiteList() {
|
||||
netheriteArmor.add("netherite_helmet");
|
||||
netheriteArmor.add("netherite_chestplate");
|
||||
netheriteArmor.add("netherite_leggings");
|
||||
netheriteArmor.add("netherite_boots");
|
||||
}
|
||||
|
||||
private void fillWoodToolsWhiteList() {
|
||||
@ -464,12 +464,12 @@ public class MaterialMapStore {
|
||||
diamondTools.add("diamond_shovel");
|
||||
}
|
||||
|
||||
private void fillNetherriteToolsWhiteList() {
|
||||
netherriteTools.add("netherrite_sword");
|
||||
netherriteTools.add("netherrite_axe");
|
||||
netherriteTools.add("netherrite_hoe");
|
||||
netherriteTools.add("netherrite_pickaxe");
|
||||
netherriteTools.add("netherrite_shovel");
|
||||
private void fillnetheriteToolsWhiteList() {
|
||||
netheriteTools.add("netherite_sword");
|
||||
netheriteTools.add("netherite_axe");
|
||||
netheriteTools.add("netherite_hoe");
|
||||
netheriteTools.add("netherite_pickaxe");
|
||||
netheriteTools.add("netherite_shovel");
|
||||
}
|
||||
|
||||
private void fillGlassBlockWhiteList() {
|
||||
@ -638,12 +638,12 @@ public class MaterialMapStore {
|
||||
return chainmailArmor.contains(id);
|
||||
}
|
||||
|
||||
public boolean isNetherriteArmor(Material material) {
|
||||
return isNetherriteArmor(material.getKey().getKey());
|
||||
public boolean isNetheriteArmor(Material material) {
|
||||
return isNetheriteArmor(material.getKey().getKey());
|
||||
}
|
||||
|
||||
public boolean isNetherriteArmor(String id) {
|
||||
return netherriteArmor.contains(id);
|
||||
public boolean isNetheriteArmor(String id) {
|
||||
return netheriteArmor.contains(id);
|
||||
}
|
||||
|
||||
public boolean isWoodTool(Material material) {
|
||||
@ -726,12 +726,12 @@ public class MaterialMapStore {
|
||||
return hoes.contains(id);
|
||||
}
|
||||
|
||||
public boolean isNetherriteTool(Material material) {
|
||||
return isNetherriteTool(material.getKey().getKey());
|
||||
public boolean isNetheriteTool(Material material) {
|
||||
return isNetheriteTool(material.getKey().getKey());
|
||||
}
|
||||
|
||||
public boolean isNetherriteTool(String id) {
|
||||
return netherriteTools.contains(id);
|
||||
public boolean isNetheriteTool(String id) {
|
||||
return netheriteTools.contains(id);
|
||||
}
|
||||
|
||||
public boolean isStringTool(Material material) {
|
||||
|
@ -298,8 +298,8 @@ public class SkillUtils {
|
||||
public static int getRepairAndSalvageQuantities(Material itemMaterial, Material recipeMaterial) {
|
||||
int quantity = 0;
|
||||
|
||||
if(mcMMO.getMaterialMapStore().isNetherriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetherriteArmor(itemMaterial)) {
|
||||
//One netherrite bar requires 4 netherrite scraps
|
||||
if(mcMMO.getMaterialMapStore().isNetheriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetheriteArmor(itemMaterial)) {
|
||||
//One netherite bar requires 4 netherite scraps
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user