Add Holograms integration and Sub-GUI editors
Holograms: - HologramManager with auto-detection of HolographicDisplays/DecentHolograms - HologramProvider interface and implementations - HologramConfig for per-mine configuration - /lm hologram <mine> [on|off] command - Updates every second showing mine name, fill %, progress bar, and timer Sub-GUI Editors: - BlocksGui - edit block weights with +/- clicks - BlockMaterialSelectionGui - paginated material picker - ResetGui - configure reset interval, percent trigger, message, commands - RewardsGui - manage reward entries - All holders moved to gui/mine/holder/ - Editors moved to gui/mine/edit/ - Main GUI (MineEditGui) moved to gui/mine/main/ Package structure reorganized to maintain max 6 files per folder.
This commit is contained in:
parent
46a9c98af6
commit
11f31e5b7a
22 changed files with 1682 additions and 45 deletions
|
|
@ -0,0 +1,43 @@
|
|||
package dev.loki.lomines.data.config.ui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Configuration for holograms displayed above mines.
|
||||
*
|
||||
* @param enabled whether holograms are enabled
|
||||
* @param format list of lines with placeholders {mine}, {percent}, {bar}, {time}
|
||||
* @param height offset above the mine region (in blocks)
|
||||
*/
|
||||
public record HologramConfig(
|
||||
boolean enabled,
|
||||
List<String> format,
|
||||
double height
|
||||
) {
|
||||
|
||||
/**
|
||||
* Creates default disabled configuration.
|
||||
*/
|
||||
public static HologramConfig disabled() {
|
||||
return new HologramConfig(
|
||||
false,
|
||||
List.of(),
|
||||
2.5
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates default enabled configuration.
|
||||
*/
|
||||
public static HologramConfig defaults() {
|
||||
return new HologramConfig(
|
||||
true,
|
||||
List.of(
|
||||
"<gold><bold>{mine}",
|
||||
"{bar} <yellow>{percent}%",
|
||||
"<gray>Сброс через: <yellow>{time}"
|
||||
),
|
||||
2.5
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,9 +12,14 @@ public record UIConfig(
|
|||
boolean actionBarEnabled,
|
||||
String actionBarFormat,
|
||||
double actionBarRange,
|
||||
String timerFormat
|
||||
String timerFormat,
|
||||
HologramConfig hologram
|
||||
) {
|
||||
|
||||
public UIConfig {
|
||||
hologram = hologram != null ? hologram : HologramConfig.disabled();
|
||||
}
|
||||
|
||||
public static final String DEFAULT_ACTIONBAR_FORMAT = "<green>{mine}</green> <gray>{percent}%</gray> <dark_gray>({time})";
|
||||
public static final String DEFAULT_TIMER_FORMAT = "mm:ss";
|
||||
|
||||
|
|
@ -70,13 +75,13 @@ public record UIConfig(
|
|||
* Default configuration.
|
||||
*/
|
||||
public static UIConfig defaults() {
|
||||
return new UIConfig(true, DEFAULT_ACTIONBAR_FORMAT, 50.0, DEFAULT_TIMER_FORMAT);
|
||||
return new UIConfig(true, DEFAULT_ACTIONBAR_FORMAT, 50.0, DEFAULT_TIMER_FORMAT, HologramConfig.defaults());
|
||||
}
|
||||
|
||||
/**
|
||||
* Disabled configuration (no UI).
|
||||
*/
|
||||
public static UIConfig disabled() {
|
||||
return new UIConfig(false, "", 0, DEFAULT_TIMER_FORMAT);
|
||||
return new UIConfig(false, "", 0, DEFAULT_TIMER_FORMAT, HologramConfig.disabled());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue