Fixing some mistakes with FQNs

This commit is contained in:
nossr50 2019-06-13 16:14:59 -07:00
parent 18a28a87b1
commit 29a712ca80

View File

@ -63,7 +63,7 @@ public class ExperienceManager {
//Iterate over all EntityType(s) //Iterate over all EntityType(s)
for (EntityType type : EntityType.values()) { for (EntityType type : EntityType.values()) {
//Match ignoring case //Match ignoring case
if (entityString.equalsIgnoreCase(entityString)) { if (entityString.equalsIgnoreCase(type.name())) {
//Check for duplicates and warn the admin //Check for duplicates and warn the admin
if (combatXPMultiplierMap.containsKey(entityString)) { if (combatXPMultiplierMap.containsKey(entityString)) {
mcMMO.p.getLogger().severe("Entity named " + entityString + " has multiple values in the combat experience config!"); mcMMO.p.getLogger().severe("Entity named " + entityString + " has multiple values in the combat experience config!");
@ -138,7 +138,7 @@ public class ExperienceManager {
if (matchingMaterial != null) { if (matchingMaterial != null) {
//Map the fully qualified name //Map the fully qualified name
fullyQualifiedBlockXPMap.put(matchingMaterial.getKey(), userConfigMap.get(string)); fullyQualifiedBlockXPMap.put(matchingMaterial.getKey().toString(), userConfigMap.get(string));
} else { } else {
mcMMO.p.getLogger().info("Could not find a match for the block named '" + string + "' among vanilla block registers"); mcMMO.p.getLogger().info("Could not find a match for the block named '" + string + "' among vanilla block registers");
} }
@ -287,7 +287,7 @@ public class ExperienceManager {
* @return true if the block has valid xp registers * @return true if the block has valid xp registers
*/ */
public boolean hasMiningXp(Material material) { public boolean hasMiningXp(Material material) {
return miningFullyQualifiedBlockXpMap.get(material.getKey()) != null; return miningFullyQualifiedBlockXpMap.get(material.getKey().toString()) != null;
} }
/** /**
@ -297,7 +297,7 @@ public class ExperienceManager {
* @return true if the block has valid xp registers * @return true if the block has valid xp registers
*/ */
public boolean hasHerbalismXp(Material material) { public boolean hasHerbalismXp(Material material) {
return herbalismFullyQualifiedBlockXpMap.get(material.getKey()) != null; return herbalismFullyQualifiedBlockXpMap.get(material.getKey().toString()) != null;
} }
/** /**
@ -307,7 +307,7 @@ public class ExperienceManager {
* @return true if the block has valid xp registers * @return true if the block has valid xp registers
*/ */
public boolean hasWoodcuttingXp(Material material) { public boolean hasWoodcuttingXp(Material material) {
return woodcuttingFullyQualifiedBlockXpMap.get(material.getKey()) != null; return woodcuttingFullyQualifiedBlockXpMap.get(material.getKey().toString()) != null;
} }
/** /**
@ -317,7 +317,7 @@ public class ExperienceManager {
* @return true if the block has valid xp registers * @return true if the block has valid xp registers
*/ */
public boolean hasExcavationXp(Material material) { public boolean hasExcavationXp(Material material) {
return excavationFullyQualifiedBlockXpMap.get(material.getKey()) != null; return excavationFullyQualifiedBlockXpMap.get(material.getKey().toString()) != null;
} }
/** /**
@ -327,7 +327,7 @@ public class ExperienceManager {
* @return the raw XP value before any modifiers are applied * @return the raw XP value before any modifiers are applied
*/ */
public int getMiningXp(Material material) { public int getMiningXp(Material material) {
return miningFullyQualifiedBlockXpMap.get(material.getKey()); return miningFullyQualifiedBlockXpMap.get(material.getKey().toString());
} }
/** /**
@ -337,7 +337,7 @@ public class ExperienceManager {
* @return the raw XP value before any modifiers are applied * @return the raw XP value before any modifiers are applied
*/ */
public int getHerbalismXp(Material material) { public int getHerbalismXp(Material material) {
return herbalismFullyQualifiedBlockXpMap.get(material.getKey()); return herbalismFullyQualifiedBlockXpMap.get(material.getKey().toString());
} }
/** /**
@ -347,7 +347,7 @@ public class ExperienceManager {
* @return the raw XP value before any modifiers are applied * @return the raw XP value before any modifiers are applied
*/ */
public int getWoodcuttingXp(Material material) { public int getWoodcuttingXp(Material material) {
return woodcuttingFullyQualifiedBlockXpMap.get(material.getKey()); return woodcuttingFullyQualifiedBlockXpMap.get(material.getKey().toString());
} }
/** /**
@ -357,7 +357,7 @@ public class ExperienceManager {
* @return the raw XP value before any modifiers are applied * @return the raw XP value before any modifiers are applied
*/ */
public int getExcavationXp(Material material) { public int getExcavationXp(Material material) {
return excavationFullyQualifiedBlockXpMap.get(material.getKey()); return excavationFullyQualifiedBlockXpMap.get(material.getKey().toString());
} }
/** /**
@ -367,7 +367,7 @@ public class ExperienceManager {
* @return the raw XP value before any modifiers are applied * @return the raw XP value before any modifiers are applied
*/ */
public int getFurnaceItemXP(Material material) { public int getFurnaceItemXP(Material material) {
return furnaceFullyQualifiedItemXpMap.get(material.getKey()); return furnaceFullyQualifiedItemXpMap.get(material.getKey().toString());
} }
/** /**