Example #1
0
    public static void Write(this BiomeCodec value, NbtList list)
    {
        var compound = new NbtCompound
        {
            new NbtTag <string>("name", value.Name),
            new NbtTag <int>("id", value.Id),

            value.WriteElement()
        };

        list.Add(compound);
    }
Example #2
0
    public static NbtCompound WriteElement(this BiomeCodec value)
    {
        var elements = new NbtCompound("element")
        {
            new NbtTag <string>("precipitation", value.Element.Precipitation),
            new NbtTag <string>("category", value.Element.Category),

            new NbtTag <float>("depth", value.Element.Depth),
            new NbtTag <float>("temperature", value.Element.Temperature),
            new NbtTag <float>("scale", value.Element.Scale),
            new NbtTag <float>("downfall", value.Element.Downfall)
        };

        value.Element.Effects.WriteEffect(elements);

        if (!value.Element.TemperatureModifier.IsNullOrEmpty())
        {
            elements.Add(new NbtTag <string>("temperature_modifier", value.Element.TemperatureModifier));
        }

        return(elements);
    }