mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
修复equipment slot手部问题
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package net.momirealms.craftengine.core.entity;
|
||||
|
||||
public enum EquipmentSlot {
|
||||
MAIN_HAND,
|
||||
OFF_HAND,
|
||||
MAINHAND,
|
||||
OFFHAND,
|
||||
FEET,
|
||||
LEGS,
|
||||
CHEST,
|
||||
HEAD,
|
||||
BODY,
|
||||
SADDLE
|
||||
SADDLE;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,7 @@ public class EquipmentData {
|
||||
if (slot == null) {
|
||||
throw new IllegalArgumentException("slot cannot be null");
|
||||
}
|
||||
// todo 重新写判断,不应该支持手部
|
||||
EquipmentSlot slotEnum = EquipmentSlot.valueOf(slot.toUpperCase(Locale.ENGLISH));
|
||||
EquipmentSlot slotEnum = EquipmentSlot.valueOf(slot.toUpperCase(Locale.ENGLISH).replace("_", ""));
|
||||
EquipmentData.Builder builder = EquipmentData.builder().slot(slotEnum);
|
||||
if (data.containsKey("asset-id")) {
|
||||
builder.assetId(Key.of(data.get("asset-id").toString()));
|
||||
|
||||
Reference in New Issue
Block a user