Refactored Feature to Mod (renamed)

This commit is contained in:
2026-03-24 11:50:21 +01:00
parent 3138f7ec62
commit 8471894248
22 changed files with 96 additions and 96 deletions
@@ -8,11 +8,11 @@ import org.saturnclient.mod.mods.*;
public class ModManager {
public static List<Mod> ENABLED_MODS = new ArrayList<>();
public static Mod[] MODS = {
new ArmorDisplayFeature(), new DayCounterFeature(), new KeystrokesFeature(), new StatusEffectsFeature(),
new AutoSprintFeature(), new FpsFeature(), new NametagsFeature(), new TpsFeature(),
new ClockFeature(), new FreelookFeature(), new NoFogFeature(), new ZoomFeature(),
new CoordinatesFeature(), new FullbrightFeature(), new PingFeature(),
new CrosshairFeature(), new HealthDisplayFeature(), new SpeedometerFeature(),
new ArmorDisplayMod(), new DayCounterMod(), new KeystrokesMod(), new StatusEffectsMod(),
new AutoSprintMod(), new FpsMod(), new NametagsMod(), new TpsMod(),
new ClockMod(), new FreelookMod(), new NoFogMod(), new ZoomMod(),
new CoordinatesMod(), new FullbrightMod(), new PingMod(),
new CrosshairMod(), new HealthDisplayMod(), new SpeedometerMod(),
};
public static void init() {
@@ -12,18 +12,18 @@ import org.saturnclient.mod.ModSpec;
import org.saturnclient.ui.RenderScope;
/**
* ArmorDisplayFeature renders the durability of the player's equipped
* ArmorDisplayMod renders the durability of the player's equipped
* armor pieces (and optionally the main-hand item) as a HUD overlay.
*
* Engine access is provided exclusively through {@link ModuleProvider}.
*/
public class ArmorDisplayFeature extends Mod implements HudMod {
public class ArmorDisplayMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final BoolProperty useMainHand = Property.bool(true);
private static final ModLayout layout = new ModLayout(40, 75);
public ArmorDisplayFeature() {
public ArmorDisplayMod() {
super(
new ModSpec("Armor Display", "armor")
.description("Displays armor durability")
@@ -35,7 +35,7 @@ public class ArmorDisplayFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -103,7 +103,7 @@ public class ArmorDisplayFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -9,14 +9,14 @@ import org.saturnclient.common.module.NetworkModule;
import org.saturnclient.common.module.PlayerModule;
/**
* AutoSprintFeature automatically enables sprinting whenever the
* AutoSprintMod automatically enables sprinting whenever the
* player moves forward and no sprint-blocking condition is active.
*/
public class AutoSprintFeature extends Mod {
public class AutoSprintMod extends Mod {
private static final BoolProperty enabled = Property.bool(false);
public AutoSprintFeature() {
public AutoSprintMod() {
super(
new ModSpec("Auto Sprint", "sprint")
.description("Makes the player always sprint")
@@ -26,7 +26,7 @@ public class AutoSprintFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -14,17 +14,17 @@ import org.saturnclient.mod.ModLayout;
import org.saturnclient.mod.ModSpec;
/**
* ClockFeature displays the real-world time as a HUD element.
* ClockMod displays the real-world time as a HUD element.
* No engine access is required; {@link LocalTime} is used directly.
*/
public class ClockFeature extends Mod implements HudMod {
public class ClockMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final SelectProperty format = Property.select(0, "24 hour", "12 hour");
private static final BoolProperty showSeconds = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
public ClockFeature() {
public ClockMod() {
super(
new ModSpec("Clock", "clock")
.description("Displays the current real-world time")
@@ -37,7 +37,7 @@ public class ClockFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -74,7 +74,7 @@ public class ClockFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -12,10 +12,10 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts;
/**
* CoordinatesFeature displays the player's current XYZ position as a
* CoordinatesMod displays the player's current XYZ position as a
* HUD element with multiple configurable display formats.
*/
public class CoordinatesFeature extends Mod implements HudMod {
public class CoordinatesMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final SelectProperty displayMethod = Property.select(0,
@@ -25,7 +25,7 @@ public class CoordinatesFeature extends Mod implements HudMod {
"Newline annotated");
private static final ModLayout layout = new ModLayout(40, 18);
public CoordinatesFeature() {
public CoordinatesMod() {
super(
new ModSpec("Coordinates", "coords")
.description("Displays your current coordinates")
@@ -37,7 +37,7 @@ public class CoordinatesFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -74,7 +74,7 @@ public class CoordinatesFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -10,16 +10,16 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Textures;
/**
* CrosshairFeature renders an alternative crosshair texture when the
* CrosshairMod renders an alternative crosshair texture when the
* player is aiming at a living entity.
*/
public class CrosshairFeature extends Mod {
public class CrosshairMod extends Mod {
public static final BoolProperty enabled = Property.bool(false);
private static final int CROSSHAIR_SIZE = 15;
public CrosshairFeature() {
public CrosshairMod() {
super(
new ModSpec("Crosshair", "crosshair")
.description("Changes the crosshair when aiming at an entity")
@@ -29,7 +29,7 @@ public class CrosshairFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -12,15 +12,15 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts;
/**
* DayCounterFeature shows how many in-game days have elapsed.
* DayCounterMod shows how many in-game days have elapsed.
* Day count is derived from the world age via {@link WorldModule}.
*/
public class DayCounterFeature extends Mod implements HudMod {
public class DayCounterMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(40, 18);
public DayCounterFeature() {
public DayCounterMod() {
super(
new ModSpec("Day Counter", "day")
.description("Displays the number of in-game days elapsed")
@@ -31,7 +31,7 @@ public class DayCounterFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -57,7 +57,7 @@ public class DayCounterFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -12,15 +12,15 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts;
/**
* FpsFeature displays the current frames-per-second as a HUD element.
* FpsMod displays the current frames-per-second as a HUD element.
* FPS is obtained from {@link RenderModule} rather than cached in the feature.
*/
public class FpsFeature extends Mod implements HudMod {
public class FpsMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
public FpsFeature() {
public FpsMod() {
super(
new ModSpec("FPS Display", "fps")
.description("Displays current FPS")
@@ -31,7 +31,7 @@ public class FpsFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -55,7 +55,7 @@ public class FpsFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -10,13 +10,13 @@ import org.saturnclient.common.module.RenderModule;
import org.saturnclient.common.provider.GLFWProvider;
/**
* FreelookFeature lets the player look around freely (in third-person)
* FreelookMod lets the player look around freely (in third-person)
* without changing the direction their character walks.
*
* Camera perspective is controlled through {@link RenderModule} so
* that the feature itself contains no direct Minecraft API calls.
*/
public class FreelookFeature extends Mod {
public class FreelookMod extends Mod {
private static final BoolProperty enabled = Property.bool(false);
private static final BoolProperty toggle = Property.bool(true);
@@ -26,7 +26,7 @@ public class FreelookFeature extends Mod {
public static boolean isFreeLooking = false;
private static boolean wasFirstPerson = false;
public FreelookFeature() {
public FreelookMod() {
super(
new ModSpec("Freelook", "freelook")
.description("Look around freely without moving your character")
@@ -38,7 +38,7 @@ public class FreelookFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -7,7 +7,7 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec;
/**
* FullbrightFeature overrides the game's gamma/brightness to let the
* FullbrightMod overrides the game's gamma/brightness to let the
* player see in complete darkness.
*
* Actual brightness injection happens in a mixin; this class owns only
@@ -16,12 +16,12 @@ import org.saturnclient.mod.ModSpec;
* No ModuleProvider is needed — this feature has no per-tick engine
* interaction; the mixin polls the static helpers directly.
*/
public class FullbrightFeature extends Mod {
public class FullbrightMod extends Mod {
private static final BoolProperty enabled = Property.bool(false);
private static final IntProperty brightness = Property.integer(100);
public FullbrightFeature() {
public FullbrightMod() {
super(
new ModSpec("Fullbright", "fullbright")
.description("Allows you to see in the dark")
@@ -50,7 +50,7 @@ public class FullbrightFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -12,18 +12,18 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts;
/**
* HealthDisplayFeature renders the player's current health as a HUD
* HealthDisplayMod renders the player's current health as a HUD
* element, with configurable display modes (raw health vs. hearts) and
* decimal precision.
*/
public class HealthDisplayFeature extends Mod implements HudMod {
public class HealthDisplayMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final SelectProperty displayMode = Property.select(0, "Health", "Hearts");
private static final SelectProperty decimals = Property.select(0, "0", "1", "2");
private static final ModLayout layout = new ModLayout(40, 18);
public HealthDisplayFeature() {
public HealthDisplayMod() {
super(
new ModSpec("Health Display", "health")
.description("Displays your current health")
@@ -36,7 +36,7 @@ public class HealthDisplayFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -71,7 +71,7 @@ public class HealthDisplayFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -12,10 +12,10 @@ import org.saturnclient.common.module.PlayerModule;
import org.saturnclient.ui.RenderScope;
/**
* KeystrokesFeature renders the WASD / mouse / space key states as an
* KeystrokesMod renders the WASD / mouse / space key states as an
* on-screen overlay.
*/
public class KeystrokesFeature extends Mod implements HudMod {
public class KeystrokesMod extends Mod implements HudMod {
// ---------------------------------------------------------------
// Configuration
@@ -46,7 +46,7 @@ public class KeystrokesFeature extends Mod implements HudMod {
private boolean w, a, s, d, lmb, rmb, space;
public KeystrokesFeature() {
public KeystrokesMod() {
super(
new ModSpec("Keystrokes", "keystrokes")
.description("Displays movement keystrokes")
@@ -62,7 +62,7 @@ public class KeystrokesFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -8,7 +8,7 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec;
/**
* NametagsFeature modifies the nametags displayed above entities.
* NametagsMod modifies the nametags displayed above entities.
*
* Actual rendering is injected via a mixin; this class owns the
* configuration and exposes two static query methods the mixin uses:
@@ -18,7 +18,7 @@ import org.saturnclient.mod.ModSpec;
* No ModuleProvider is required here because the mixin passes the
* already-resolved {@link EntityModule.EntityState} directly.
*/
public class NametagsFeature extends Mod {
public class NametagsMod extends Mod {
// ---------------------------------------------------------------
// Configuration
@@ -51,7 +51,7 @@ public class NametagsFeature extends Mod {
// Constructor
// ---------------------------------------------------------------
public NametagsFeature() {
public NametagsMod() {
super(
new ModSpec("Nametags", "nametags")
.description("Allows you to modify entity nametags")
@@ -130,7 +130,7 @@ public class NametagsFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -6,17 +6,17 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec;
/**
* NoFogFeature suppresses distance fog and (optionally) liquid fog.
* NoFogMod suppresses distance fog and (optionally) liquid fog.
*
* Like {@link FullbrightFeature}, the actual suppression is applied
* Like {@link FullbrightMod}, the actual suppression is applied
* inside a mixin. This class owns the configuration and provides
* static query methods the mixin calls.
*/
public class NoFogFeature extends Mod {
public class NoFogMod extends Mod {
private static final BoolProperty enabled = Property.bool(false);
public NoFogFeature() {
public NoFogMod() {
super(
new ModSpec("No Fog", "nofog")
.description("Stops fog from rendering")
@@ -31,7 +31,7 @@ public class NoFogFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -11,15 +11,15 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts;
/**
* PingFeature displays the current server round-trip time in
* PingMod displays the current server round-trip time in
* milliseconds as a HUD element.
*/
public class PingFeature extends Mod implements HudMod {
public class PingMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
public PingFeature() {
public PingMod() {
super(
new ModSpec("Ping Display", "ping")
.description("Displays ping to the server")
@@ -30,7 +30,7 @@ public class PingFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -54,7 +54,7 @@ public class PingFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -13,10 +13,10 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts;
/**
* SpeedometerFeature displays the player's current movement speed as
* SpeedometerMod displays the player's current movement speed as
* a HUD element. Velocity data comes from {@link PlayerModule}.
*/
public class SpeedometerFeature extends Mod implements HudMod {
public class SpeedometerMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final SelectProperty axis = Property.select(1, "Absolute", "Horizontal", "Vertical");
@@ -26,7 +26,7 @@ public class SpeedometerFeature extends Mod implements HudMod {
private double cachedSpeed = 0.0;
public SpeedometerFeature() {
public SpeedometerMod() {
super(
new ModSpec("Speedometer", "speed")
.description("Displays your current movement speed")
@@ -40,7 +40,7 @@ public class SpeedometerFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -89,7 +89,7 @@ public class SpeedometerFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -14,7 +14,7 @@ import org.saturnclient.mod.ModSpec;
import org.saturnclient.ui.RenderScope;
/**
* StatusEffectsFeature displays the player's active potion effects as
* StatusEffectsMod displays the player's active potion effects as
* a HUD overlay.
*
* The effect list is supplied by the platform through an interface
@@ -22,12 +22,12 @@ import org.saturnclient.ui.RenderScope;
* Until that is wired up, the existing {@link StatusEffectsInterface}
* bridge is used, accessed via {@link ModuleProvider}.
*/
public class StatusEffectsFeature extends Mod implements HudMod {
public class StatusEffectsMod extends Mod implements HudMod {
public static final BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, 0);
public StatusEffectsFeature() {
public StatusEffectsMod() {
super(
new ModSpec("Status Effects", "effect")
.description("Displays active status effects")
@@ -38,7 +38,7 @@ public class StatusEffectsFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -87,7 +87,7 @@ public class StatusEffectsFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -10,7 +10,7 @@ import org.saturnclient.mod.ModLayout;
import org.saturnclient.mod.ModSpec;
/**
* TpsFeature estimates the server's ticks-per-second by measuring the
* TpsMod estimates the server's ticks-per-second by measuring the
* elapsed real time between consecutive world-time packets.
*
* TPS calculation is event-driven: the networking layer (or mixin)
@@ -18,7 +18,7 @@ import org.saturnclient.mod.ModSpec;
* arrives. No ModuleProvider is required because there is no
* per-frame polling of the engine.
*/
public class TpsFeature extends Mod implements HudMod {
public class TpsMod extends Mod implements HudMod {
private static final BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
@@ -44,7 +44,7 @@ public class TpsFeature extends Mod implements HudMod {
// Constructor
// ---------------------------------------------------------------
public TpsFeature() {
public TpsMod() {
super(
new ModSpec("TPS Display", "tps")
.description("Displays the server's ticks per second")
@@ -98,7 +98,7 @@ public class TpsFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// HudFeature
// HudMod
// ---------------------------------------------------------------
@Override
@@ -122,7 +122,7 @@ public class TpsFeature extends Mod implements HudMod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override
@@ -9,14 +9,14 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec;
/**
* ZoomFeature multiplies the camera's field-of-view to create an
* ZoomMod multiplies the camera's field-of-view to create an
* optical-zoom effect.
*
* The FOV override is applied inside a mixin that polls
* {@link #shouldZoom()} and {@link #getZoomLevel()} each frame.
* No ModuleProvider is needed — there is no per-tick engine query.
*/
public class ZoomFeature extends Mod {
public class ZoomMod extends Mod {
private static final BoolProperty enabled = Property.bool(false);
private static final BoolProperty toggle = Property.bool(false);
@@ -26,7 +26,7 @@ public class ZoomFeature extends Mod {
/** Whether zoom is currently active (read by the FOV mixin). */
public static boolean isZooming = false;
public ZoomFeature() {
public ZoomMod() {
super(
new ModSpec("Zoom", "zoom")
.description("Zoom in for a closer view")
@@ -39,7 +39,7 @@ public class ZoomFeature extends Mod {
}
// ---------------------------------------------------------------
// Feature contract
// Mod contract
// ---------------------------------------------------------------
@Override