9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2025-12-27 10:59:22 +00:00

Switched getSlot to switch

This commit is contained in:
Auxilor
2021-01-23 12:24:15 +00:00
parent bd42f45972
commit a65ab65b9f
2 changed files with 14 additions and 21 deletions

View File

@@ -47,7 +47,7 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:3.2.0'
compileOnly 'com.willfp:eco:3.2.1'
compileOnly 'org.jetbrains:annotations:19.0.0'

View File

@@ -89,26 +89,19 @@ public enum ArmorSlot {
*/
@Nullable
public static ArmorSlot getSlot(@NotNull final String name) {
if (name.equalsIgnoreCase("helmet")) {
return HELMET;
switch (name.toLowerCase()) {
case "helmet":
return HELMET;
case "chestplate":
return CHESTPLATE;
case "elytra":
return ELYTRA;
case "leggings":
return LEGGINGS;
case "boots":
return BOOTS;
default:
return null;
}
if (name.equalsIgnoreCase("chestplate")) {
return CHESTPLATE;
}
if (name.equalsIgnoreCase("elytra")) {
return ELYTRA;
}
if (name.equalsIgnoreCase("leggings")) {
return LEGGINGS;
}
if (name.equalsIgnoreCase("boots")) {
return BOOTS;
}
return null;
}
}