mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
进一步修复hand
This commit is contained in:
@@ -107,7 +107,7 @@ public class AxeItemBehavior extends ItemBehavior {
|
||||
player.swingHand(context.getHand());
|
||||
}
|
||||
// shrink item amount
|
||||
item.hurtAndBreak(1, player, context.getHand() == InteractionHand.MAIN_HAND ? EquipmentSlot.MAIN_HAND : EquipmentSlot.OFF_HAND);
|
||||
item.hurtAndBreak(1, player, context.getHand() == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND);
|
||||
}
|
||||
return InteractionResult.SUCCESS_AND_CANCEL;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ public final class EquipmentSlotUtils {
|
||||
|
||||
public static Object toNMSEquipmentSlot(EquipmentSlot equipmentSlot) {
|
||||
return switch (equipmentSlot) {
|
||||
case MAIN_HAND -> CoreReflections.instance$EquipmentSlot$MAINHAND;
|
||||
case OFF_HAND -> CoreReflections.instance$EquipmentSlot$OFFHAND;
|
||||
case MAINHAND -> CoreReflections.instance$EquipmentSlot$MAINHAND;
|
||||
case OFFHAND -> CoreReflections.instance$EquipmentSlot$OFFHAND;
|
||||
case FEET -> CoreReflections.instance$EquipmentSlot$FEET;
|
||||
case LEGS -> CoreReflections.instance$EquipmentSlot$LEGS;
|
||||
case CHEST -> CoreReflections.instance$EquipmentSlot$CHEST;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class DamageItemFunction<CTX extends Context> extends AbstractConditional
|
||||
} else if (item == null) {
|
||||
return;
|
||||
}
|
||||
EquipmentSlot slot = hand == null ? null : hand == InteractionHand.MAIN_HAND ? EquipmentSlot.MAIN_HAND : EquipmentSlot.OFF_HAND;
|
||||
EquipmentSlot slot = hand == null ? null : hand == InteractionHand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND;
|
||||
item.hurtAndBreak(amount.getInt(ctx), player, slot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user