com.parzivail.pswg.character.BakedSpeciesVariable Maven / Gradle / Ivy
package com.parzivail.pswg.character;
import com.google.common.collect.ImmutableList;
import com.parzivail.pswg.api.HumanoidCustomizationOptions;
import java.util.List;
import net.minecraft.class_2960;
public class BakedSpeciesVariable extends SpeciesVariable
{
private String defaultValue;
private List possibleValues;
public BakedSpeciesVariable(class_2960 sourceSpecies, String name)
{
super(sourceSpecies, name);
}
public void bakeWith(HumanoidCustomizationOptions options)
{
if (this.defaultValue != null || this.possibleValues != null)
throw new RuntimeException("Cannot re-bake species variable");
this.defaultValue = options.defaultValue;
this.possibleValues = ImmutableList.copyOf(options.possibleValues);
if (this.defaultValue == null)
throw new RuntimeException("Species variable cannot have null default value");
}
@Override
public List getPossibleValues()
{
return possibleValues;
}
@Override
public String getDefaultValue()
{
return defaultValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy