minecraft-source/src/net/minecraft/world/InteractionResultHolder.java

36 lines
1.1 KiB
Java

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