mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-22 08:29:27 +00:00
clean: clean HMCCInventoryUtils with new static variables
This commit is contained in:
@@ -16,8 +16,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.hibiscusmc.hmccosmetics.cosmetic.CosmeticSlot.*;
|
|
||||||
|
|
||||||
public class HMCCInventoryUtils {
|
public class HMCCInventoryUtils {
|
||||||
|
|
||||||
private static final Map<CosmeticSlot, EquipmentSlot> SLOT_MAP = new HashMap<>();
|
private static final Map<CosmeticSlot, EquipmentSlot> SLOT_MAP = new HashMap<>();
|
||||||
@@ -71,9 +69,9 @@ public class HMCCInventoryUtils {
|
|||||||
|
|
||||||
public static CosmeticSlot getItemSlotToCosmeticSlot(final EnumWrappers.ItemSlot slot) {
|
public static CosmeticSlot getItemSlotToCosmeticSlot(final EnumWrappers.ItemSlot slot) {
|
||||||
return switch (slot) {
|
return switch (slot) {
|
||||||
case HEAD -> HELMET;
|
case HEAD -> CosmeticSlot.HELMET;
|
||||||
case CHEST -> CHESTPLATE;
|
case CHEST -> CosmeticSlot.CHESTPLATE;
|
||||||
case LEGS -> LEGGINGS;
|
case LEGS -> CosmeticSlot.LEGGINGS;
|
||||||
case FEET -> CosmeticSlot.BOOTS;
|
case FEET -> CosmeticSlot.BOOTS;
|
||||||
case OFFHAND -> CosmeticSlot.OFFHAND;
|
case OFFHAND -> CosmeticSlot.OFFHAND;
|
||||||
case MAINHAND -> CosmeticSlot.MAINHAND;
|
case MAINHAND -> CosmeticSlot.MAINHAND;
|
||||||
@@ -86,9 +84,9 @@ public class HMCCInventoryUtils {
|
|||||||
case HAND -> CosmeticSlot.MAINHAND;
|
case HAND -> CosmeticSlot.MAINHAND;
|
||||||
case OFF_HAND -> CosmeticSlot.OFFHAND;
|
case OFF_HAND -> CosmeticSlot.OFFHAND;
|
||||||
case FEET -> CosmeticSlot.BOOTS;
|
case FEET -> CosmeticSlot.BOOTS;
|
||||||
case LEGS -> LEGGINGS;
|
case LEGS -> CosmeticSlot.LEGGINGS;
|
||||||
case CHEST -> CHESTPLATE;
|
case CHEST -> CosmeticSlot.CHESTPLATE;
|
||||||
case HEAD -> HELMET;
|
case HEAD -> CosmeticSlot.HELMET;
|
||||||
default -> null;
|
default -> null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -98,13 +96,13 @@ public class HMCCInventoryUtils {
|
|||||||
public static CosmeticSlot BukkitCosmeticSlot(int slot) {
|
public static CosmeticSlot BukkitCosmeticSlot(int slot) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case 36 -> {
|
case 36 -> {
|
||||||
return HELMET;
|
return CosmeticSlot.HELMET;
|
||||||
}
|
}
|
||||||
case 37 -> {
|
case 37 -> {
|
||||||
return CHESTPLATE;
|
return CosmeticSlot.CHESTPLATE;
|
||||||
}
|
}
|
||||||
case 38 -> {
|
case 38 -> {
|
||||||
return LEGGINGS;
|
return CosmeticSlot.LEGGINGS;
|
||||||
}
|
}
|
||||||
case 39 -> {
|
case 39 -> {
|
||||||
return CosmeticSlot.BOOTS;
|
return CosmeticSlot.BOOTS;
|
||||||
@@ -123,13 +121,13 @@ public class HMCCInventoryUtils {
|
|||||||
public static CosmeticSlot NMSCosmeticSlot(int slot) {
|
public static CosmeticSlot NMSCosmeticSlot(int slot) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case 5 -> {
|
case 5 -> {
|
||||||
return HELMET;
|
return CosmeticSlot.HELMET;
|
||||||
}
|
}
|
||||||
case 6 -> {
|
case 6 -> {
|
||||||
return CHESTPLATE;
|
return CosmeticSlot.CHESTPLATE;
|
||||||
}
|
}
|
||||||
case 7 -> {
|
case 7 -> {
|
||||||
return LEGGINGS;
|
return CosmeticSlot.LEGGINGS;
|
||||||
}
|
}
|
||||||
case 8 -> {
|
case 8 -> {
|
||||||
return CosmeticSlot.BOOTS;
|
return CosmeticSlot.BOOTS;
|
||||||
|
|||||||
Reference in New Issue
Block a user