package net.minecraft.world.entity.ai.attributes;

import java.util.function.Consumer;
import java.util.Collection;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import javax.annotation.Nullable;
import java.util.UUID;
import java.util.Set;

public interface AttributeInstance {
    Attribute getAttribute();
    
    double getBaseValue();
    
    void setBaseValue(final double double1);
    
    Set<AttributeModifier> getModifiers(final AttributeModifier.Operation a);
    
    Set<AttributeModifier> getModifiers();
    
    boolean hasModifier(final AttributeModifier als);
    
    @Nullable
    AttributeModifier getModifier(final UUID uUID);
    
    void addModifier(final AttributeModifier als);
    
    void removeModifier(final AttributeModifier als);
    
    void removeModifier(final UUID uUID);
    
    void removeModifiers();
    
    double getValue();
    
    default void copyFrom(final AttributeInstance alr) {
        this.setBaseValue(alr.getBaseValue());
        final Set<AttributeModifier> set3 = alr.getModifiers();
        final Set<AttributeModifier> set4 = this.getModifiers();
        final ImmutableSet<AttributeModifier> immutableSet5 = ImmutableSet.<AttributeModifier>copyOf(Sets.<AttributeModifier>difference(set3, set4));
        final ImmutableSet<AttributeModifier> immutableSet6 = ImmutableSet.<AttributeModifier>copyOf(Sets.<AttributeModifier>difference(set4, set3));
        immutableSet5.forEach(this::addModifier);
        immutableSet6.forEach(this::removeModifier);
    }
}
