// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.modules.interaction;

import com.hypixel.hytale.protocol.GameMode;
import com.hypixel.hytale.server.core.entity.entities.Player;
import javax.annotation.Nonnull;
import com.hypixel.hytale.component.ComponentAccessor;
import javax.annotation.Nullable;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Ref;

public class BlockInteractionUtils
{
    public static boolean isNaturalAction(@Nullable final Ref<EntityStore> ref, @Nonnull final ComponentAccessor<EntityStore> componentAccessor) {
        if (ref == null) {
            return true;
        }
        final Player playerComponent = componentAccessor.getComponent(ref, Player.getComponentType());
        return playerComponent == null || playerComponent.getGameMode() == GameMode.Adventure;
    }
}
