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);
}
Aggregations