package net.minecraft.world; public class InteractionResultHolder { private final InteractionResult result; private final T object; public InteractionResultHolder(InteractionResult result, T object) { this.result = result; this.object = object; } public InteractionResult getResult() { return this.result; } public T getObject() { return this.object; } public static InteractionResultHolder success(T type) { return new InteractionResultHolder<>(InteractionResult.SUCCESS, type); } public static InteractionResultHolder consume(T type) { return new InteractionResultHolder<>(InteractionResult.CONSUME, type); } public static InteractionResultHolder pass(T type) { return new InteractionResultHolder<>(InteractionResult.PASS, type); } public static InteractionResultHolder fail(T type) { return new InteractionResultHolder<>(InteractionResult.FAIL, type); } public static InteractionResultHolder sidedSuccess(T object, boolean isClientSide) { return isClientSide ? success(object) : consume(object); } }