minecraft-src/net/minecraft/world/InteractionResult.java
2025-07-04 01:41:11 +03:00

26 lines
578 B
Java

package net.minecraft.world;
public enum InteractionResult {
SUCCESS,
SUCCESS_NO_ITEM_USED,
CONSUME,
CONSUME_PARTIAL,
PASS,
FAIL;
public boolean consumesAction() {
return this == SUCCESS || this == CONSUME || this == CONSUME_PARTIAL || this == SUCCESS_NO_ITEM_USED;
}
public boolean shouldSwing() {
return this == SUCCESS || this == SUCCESS_NO_ITEM_USED;
}
public boolean indicateItemUse() {
return this == SUCCESS || this == CONSUME;
}
public static InteractionResult sidedSuccess(boolean isClientSide) {
return isClientSide ? SUCCESS : CONSUME;
}
}