package net.minecraft.client;

import java.util.Comparator;
import java.util.Arrays;
import net.minecraft.util.Mth;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.chat.Component;

public enum NarratorStatus {
    OFF(0, "options.narrator.off"), 
    ALL(1, "options.narrator.all"), 
    CHAT(2, "options.narrator.chat"), 
    SYSTEM(3, "options.narrator.system");
    
    private static final NarratorStatus[] BY_ID;
    private final int id;
    private final Component name;
    
    private NarratorStatus(final int integer3, final String string4) {
        this.id = integer3;
        this.name = new TranslatableComponent(string4);
    }
    
    public int getId() {
        return this.id;
    }
    
    public Component getName() {
        return this.name;
    }
    
    public static NarratorStatus byId(final int integer) {
        return NarratorStatus.BY_ID[Mth.positiveModulo(integer, NarratorStatus.BY_ID.length)];
    }
    
    static {
        BY_ID = Arrays.<NarratorStatus>stream(values()).sorted(Comparator.comparingInt(NarratorStatus::getId)).<NarratorStatus>toArray(NarratorStatus[]::new);
    }
}
