package sh.grimmer.bettershulkers.data;

import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;

import org.jetbrains.annotations.Nullable;

public final class ShulkerBoxTracker {

    @Nullable
    private static ShulkerBoxBlockEntity lastOpened;

    private ShulkerBoxTracker() {
    }

    @Nullable
    public static ShulkerBoxBlockEntity getLastOpened() {
        return lastOpened;
    }

    public static void setLastOpened(@Nullable ShulkerBoxBlockEntity blockEntity) {
        lastOpened = blockEntity;
    }

    public static ShulkerBoxBlockEntity consumeLastOpened() {
        ShulkerBoxBlockEntity be = lastOpened;
        lastOpened = null;
        return be;
    }
}
