|
@@ -1,23 +1,37 @@
|
|
|
-package me.lortseam.uglyscoreboardfix;
|
|
|
+package me.lortseam.uglyscoreboardfix.config;
|
|
|
|
|
|
import lombok.AccessLevel;
|
|
|
import lombok.Getter;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
-import me.lortseam.completeconfig.api.ConfigCategory;
|
|
|
+import me.lortseam.completeconfig.ConfigHandler;
|
|
|
+import me.lortseam.completeconfig.api.ConfigEntry;
|
|
|
+import me.lortseam.completeconfig.api.ConfigGroup;
|
|
|
+import me.lortseam.uglyscoreboardfix.HidePart;
|
|
|
+import me.lortseam.uglyscoreboardfix.SidebarPosition;
|
|
|
+import me.lortseam.uglyscoreboardfix.UglyScoreboardFix;
|
|
|
import net.minecraft.scoreboard.ScoreboardObjective;
|
|
|
import net.minecraft.scoreboard.ScoreboardPlayerScore;
|
|
|
|
|
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
|
|
public final class Config {
|
|
|
|
|
|
+ @Getter(AccessLevel.PACKAGE)
|
|
|
+ private static ConfigHandler handler;
|
|
|
public static final Sidebar SIDEBAR = new Sidebar();
|
|
|
|
|
|
+ public static void register() {
|
|
|
+ handler = me.lortseam.completeconfig.data.Config.builder(UglyScoreboardFix.MOD_ID)
|
|
|
+ .add(SIDEBAR)
|
|
|
+ .build();
|
|
|
+ }
|
|
|
+
|
|
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
|
|
- public static final class Sidebar implements ConfigCategory {
|
|
|
+ public static final class Sidebar implements ConfigGroup {
|
|
|
|
|
|
public final Hiding HIDING = new Hiding();
|
|
|
|
|
|
@Getter
|
|
|
+ @ConfigEntry(comment = "RIGHT (default) or LEFT")
|
|
|
private SidebarPosition position = SidebarPosition.RIGHT;
|
|
|
|
|
|
@Override
|
|
@@ -26,9 +40,11 @@ public final class Config {
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
|
|
- public static final class Hiding implements ConfigCategory {
|
|
|
+ public static final class Hiding implements ConfigGroup {
|
|
|
|
|
|
+ @ConfigEntry(comment = "ENABLED or DISABLED or AUTO (only enabled when scores are in consecutive order)")
|
|
|
private State state = State.AUTO;
|
|
|
+ @ConfigEntry(comment = "SCORES or SIDEBAR")
|
|
|
private HidePart hidePart = HidePart.SCORES;
|
|
|
|
|
|
public boolean shouldHide(HidePart hidePart, ScoreboardObjective objective) {
|