Search in sources :

Example 1 with SpongeValue

use of org.spongepowered.common.data.value.mutable.SpongeValue in project SpongeCommon by SpongePowered.

the class MixinEntityLlama method llamaVariant.

@Override
public Value<LlamaVariant> llamaVariant() {
    final int i = getVariant();
    final LlamaVariant variant;
    if (i == 0) {
        variant = LlamaVariants.CREAMY;
    } else if (i == 1) {
        variant = LlamaVariants.WHITE;
    } else if (i == 2) {
        variant = LlamaVariants.BROWN;
    } else if (i == 3) {
        variant = LlamaVariants.GRAY;
    } else {
        // Basically some validation
        setVariant(0);
        variant = LlamaVariants.CREAMY;
    }
    return new SpongeValue<>(Keys.LLAMA_VARIANT, DataConstants.Llama.DEFAULT_VARIANT, variant);
}
Also used : LlamaVariant(org.spongepowered.api.data.type.LlamaVariant) SpongeValue(org.spongepowered.common.data.value.mutable.SpongeValue)

Aggregations

LlamaVariant (org.spongepowered.api.data.type.LlamaVariant)1 SpongeValue (org.spongepowered.common.data.value.mutable.SpongeValue)1