| 32 | import net.minecraft.sound.SoundEvents; |
| 33 | |
| 34 | public class Mod { |
| 35 | |
| 36 | protected static MinecraftClient mc = MinecraftClient.getInstance(); |
| 37 | public String displayName; |
| 38 | public String description; |
| 39 | private Category category; |
| 40 | public boolean expanded; |
| 41 | private ArrayList<Setting> settings = new ArrayList<>(); |
| 42 | @Expose |
| 43 | @SerializedName("key") |
| 44 | public int keyCode; |
| 45 | @Expose |
| 46 | @SerializedName("enabled") |
| 47 | public boolean enabled; |
| 48 | @Expose |
| 49 | @SerializedName("name") |
| 50 | public String name; |
| 51 | @Expose |
| 52 | @SerializedName("settings") |
| 53 | public ConfigSetting[] cfgSettings; |
| 54 | public boolean wasFlag = false; |
| 55 | public BooleanSetting visible = new BooleanSetting("Visible", true); |
| 56 | public transient int index; |
| 57 | public transient double animation = 0; |
| 58 | public transient float offset = 0; |
| 59 | |
| 60 | private boolean binding; |
| 61 | |
| 62 | public Mod(String name, String description, Category category) { |
| 63 | this.name = name; |
| 64 | this.category = category; |
| 65 | this.description = description; |
| 66 | enabled = false; |
| 67 | displayName = name; |
| 68 | this.keyCode = 0; |
| 69 | this.binding = false; |
| 70 | } |
| 71 | |
| 72 | public void addSetting(Setting setting) { |
| 73 | this.settings.sort(Comparator.comparing(s -> s == visible ? 1 : 0)); |
| 74 | getSettings().add(setting); |
| 75 | } |
| 76 | |
| 77 | public ArrayList<Setting> getSettings() { |
| 78 | this.settings.sort(Comparator.comparing(s -> s == visible ? 1 : 0)); |
| 79 | return settings; |
| 80 | } |
| 81 | |
| 82 | public void addSettings(Setting... settings) { |
| 83 | this.settings.sort(Comparator.comparing(s -> s == visible ? 1 : 0)); |
| 84 | for (Setting setting : settings) { |
| 85 | addSetting(setting); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | public String getDescription() { |
| 90 | return description; |
| 91 | } |
nothing calls this directly
no test coverage detected