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
@@ -13,7 +13,7 @@ public interface WorldModule {
/** /**
* Returns the total world age in ticks. * Returns the total world age in ticks.
* Used by {@link org.saturnclient.feature.TpsFeature} to compute TPS. * Used by {@link org.saturnclient.feature.TpsMod} to compute TPS.
*/ */
long getWorldAge(); long getWorldAge();
@@ -11,7 +11,7 @@ import org.saturnclient.common.module.WorldModule;
* all common engine abstractions. Implementations are supplied by * all common engine abstractions. Implementations are supplied by
* the platform-specific client bootstrap (e.g. the Fabric/Forge mod). * the platform-specific client bootstrap (e.g. the Fabric/Forge mod).
* *
* Features should receive a ModuleProvider in their constructor and * Mods should receive a ModuleProvider in their constructor and
* store it; they must NOT cache individual sub-modules across ticks * store it; they must NOT cache individual sub-modules across ticks
* because the provider may swap implementations at runtime (e.g. on * because the provider may swap implementations at runtime (e.g. on
* world change). * world change).
@@ -8,11 +8,11 @@ import org.saturnclient.mod.mods.*;
public class ModManager { public class ModManager {
public static List<Mod> ENABLED_MODS = new ArrayList<>(); public static List<Mod> ENABLED_MODS = new ArrayList<>();
public static Mod[] MODS = { public static Mod[] MODS = {
new ArmorDisplayFeature(), new DayCounterFeature(), new KeystrokesFeature(), new StatusEffectsFeature(), new ArmorDisplayMod(), new DayCounterMod(), new KeystrokesMod(), new StatusEffectsMod(),
new AutoSprintFeature(), new FpsFeature(), new NametagsFeature(), new TpsFeature(), new AutoSprintMod(), new FpsMod(), new NametagsMod(), new TpsMod(),
new ClockFeature(), new FreelookFeature(), new NoFogFeature(), new ZoomFeature(), new ClockMod(), new FreelookMod(), new NoFogMod(), new ZoomMod(),
new CoordinatesFeature(), new FullbrightFeature(), new PingFeature(), new CoordinatesMod(), new FullbrightMod(), new PingMod(),
new CrosshairFeature(), new HealthDisplayFeature(), new SpeedometerFeature(), new CrosshairMod(), new HealthDisplayMod(), new SpeedometerMod(),
}; };
public static void init() { public static void init() {
@@ -12,18 +12,18 @@ import org.saturnclient.mod.ModSpec;
import org.saturnclient.ui.RenderScope; 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. * armor pieces (and optionally the main-hand item) as a HUD overlay.
* *
* Engine access is provided exclusively through {@link ModuleProvider}. * 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 enabled = Property.bool(false);
private static final BoolProperty useMainHand = Property.bool(true); private static final BoolProperty useMainHand = Property.bool(true);
private static final ModLayout layout = new ModLayout(40, 75); private static final ModLayout layout = new ModLayout(40, 75);
public ArmorDisplayFeature() { public ArmorDisplayMod() {
super( super(
new ModSpec("Armor Display", "armor") new ModSpec("Armor Display", "armor")
.description("Displays armor durability") .description("Displays armor durability")
@@ -35,7 +35,7 @@ public class ArmorDisplayFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -103,7 +103,7 @@ public class ArmorDisplayFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -9,14 +9,14 @@ import org.saturnclient.common.module.NetworkModule;
import org.saturnclient.common.module.PlayerModule; 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. * 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); private static final BoolProperty enabled = Property.bool(false);
public AutoSprintFeature() { public AutoSprintMod() {
super( super(
new ModSpec("Auto Sprint", "sprint") new ModSpec("Auto Sprint", "sprint")
.description("Makes the player always sprint") .description("Makes the player always sprint")
@@ -26,7 +26,7 @@ public class AutoSprintFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -14,17 +14,17 @@ import org.saturnclient.mod.ModLayout;
import org.saturnclient.mod.ModSpec; 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. * 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 BoolProperty enabled = Property.bool(false);
private static final SelectProperty format = Property.select(0, "24 hour", "12 hour"); private static final SelectProperty format = Property.select(0, "24 hour", "12 hour");
private static final BoolProperty showSeconds = Property.bool(false); private static final BoolProperty showSeconds = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight()); private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
public ClockFeature() { public ClockMod() {
super( super(
new ModSpec("Clock", "clock") new ModSpec("Clock", "clock")
.description("Displays the current real-world time") .description("Displays the current real-world time")
@@ -37,7 +37,7 @@ public class ClockFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -74,7 +74,7 @@ public class ClockFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -12,10 +12,10 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; 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. * 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 BoolProperty enabled = Property.bool(false);
private static final SelectProperty displayMethod = Property.select(0, private static final SelectProperty displayMethod = Property.select(0,
@@ -25,7 +25,7 @@ public class CoordinatesFeature extends Mod implements HudMod {
"Newline annotated"); "Newline annotated");
private static final ModLayout layout = new ModLayout(40, 18); private static final ModLayout layout = new ModLayout(40, 18);
public CoordinatesFeature() { public CoordinatesMod() {
super( super(
new ModSpec("Coordinates", "coords") new ModSpec("Coordinates", "coords")
.description("Displays your current coordinates") .description("Displays your current coordinates")
@@ -37,7 +37,7 @@ public class CoordinatesFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -74,7 +74,7 @@ public class CoordinatesFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -10,16 +10,16 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Textures; 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. * 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); public static final BoolProperty enabled = Property.bool(false);
private static final int CROSSHAIR_SIZE = 15; private static final int CROSSHAIR_SIZE = 15;
public CrosshairFeature() { public CrosshairMod() {
super( super(
new ModSpec("Crosshair", "crosshair") new ModSpec("Crosshair", "crosshair")
.description("Changes the crosshair when aiming at an entity") .description("Changes the crosshair when aiming at an entity")
@@ -29,7 +29,7 @@ public class CrosshairFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -12,15 +12,15 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; 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}. * 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 BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(40, 18); private static final ModLayout layout = new ModLayout(40, 18);
public DayCounterFeature() { public DayCounterMod() {
super( super(
new ModSpec("Day Counter", "day") new ModSpec("Day Counter", "day")
.description("Displays the number of in-game days elapsed") .description("Displays the number of in-game days elapsed")
@@ -31,7 +31,7 @@ public class DayCounterFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -57,7 +57,7 @@ public class DayCounterFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -12,15 +12,15 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; 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. * 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 BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight()); private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
public FpsFeature() { public FpsMod() {
super( super(
new ModSpec("FPS Display", "fps") new ModSpec("FPS Display", "fps")
.description("Displays current FPS") .description("Displays current FPS")
@@ -31,7 +31,7 @@ public class FpsFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -55,7 +55,7 @@ public class FpsFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -10,13 +10,13 @@ import org.saturnclient.common.module.RenderModule;
import org.saturnclient.common.provider.GLFWProvider; 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. * without changing the direction their character walks.
* *
* Camera perspective is controlled through {@link RenderModule} so * Camera perspective is controlled through {@link RenderModule} so
* that the feature itself contains no direct Minecraft API calls. * 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 enabled = Property.bool(false);
private static final BoolProperty toggle = Property.bool(true); private static final BoolProperty toggle = Property.bool(true);
@@ -26,7 +26,7 @@ public class FreelookFeature extends Mod {
public static boolean isFreeLooking = false; public static boolean isFreeLooking = false;
private static boolean wasFirstPerson = false; private static boolean wasFirstPerson = false;
public FreelookFeature() { public FreelookMod() {
super( super(
new ModSpec("Freelook", "freelook") new ModSpec("Freelook", "freelook")
.description("Look around freely without moving your character") .description("Look around freely without moving your character")
@@ -38,7 +38,7 @@ public class FreelookFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -7,7 +7,7 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec; 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. * player see in complete darkness.
* *
* Actual brightness injection happens in a mixin; this class owns only * 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 * No ModuleProvider is needed — this feature has no per-tick engine
* interaction; the mixin polls the static helpers directly. * 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 BoolProperty enabled = Property.bool(false);
private static final IntProperty brightness = Property.integer(100); private static final IntProperty brightness = Property.integer(100);
public FullbrightFeature() { public FullbrightMod() {
super( super(
new ModSpec("Fullbright", "fullbright") new ModSpec("Fullbright", "fullbright")
.description("Allows you to see in the dark") .description("Allows you to see in the dark")
@@ -50,7 +50,7 @@ public class FullbrightFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -12,18 +12,18 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; 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 * element, with configurable display modes (raw health vs. hearts) and
* decimal precision. * 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 BoolProperty enabled = Property.bool(false);
private static final SelectProperty displayMode = Property.select(0, "Health", "Hearts"); private static final SelectProperty displayMode = Property.select(0, "Health", "Hearts");
private static final SelectProperty decimals = Property.select(0, "0", "1", "2"); private static final SelectProperty decimals = Property.select(0, "0", "1", "2");
private static final ModLayout layout = new ModLayout(40, 18); private static final ModLayout layout = new ModLayout(40, 18);
public HealthDisplayFeature() { public HealthDisplayMod() {
super( super(
new ModSpec("Health Display", "health") new ModSpec("Health Display", "health")
.description("Displays your current health") .description("Displays your current health")
@@ -36,7 +36,7 @@ public class HealthDisplayFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -71,7 +71,7 @@ public class HealthDisplayFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -12,10 +12,10 @@ import org.saturnclient.common.module.PlayerModule;
import org.saturnclient.ui.RenderScope; 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. * on-screen overlay.
*/ */
public class KeystrokesFeature extends Mod implements HudMod { public class KeystrokesMod extends Mod implements HudMod {
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Configuration // Configuration
@@ -46,7 +46,7 @@ public class KeystrokesFeature extends Mod implements HudMod {
private boolean w, a, s, d, lmb, rmb, space; private boolean w, a, s, d, lmb, rmb, space;
public KeystrokesFeature() { public KeystrokesMod() {
super( super(
new ModSpec("Keystrokes", "keystrokes") new ModSpec("Keystrokes", "keystrokes")
.description("Displays movement keystrokes") .description("Displays movement keystrokes")
@@ -62,7 +62,7 @@ public class KeystrokesFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -8,7 +8,7 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec; 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 * Actual rendering is injected via a mixin; this class owns the
* configuration and exposes two static query methods the mixin uses: * 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 * No ModuleProvider is required here because the mixin passes the
* already-resolved {@link EntityModule.EntityState} directly. * already-resolved {@link EntityModule.EntityState} directly.
*/ */
public class NametagsFeature extends Mod { public class NametagsMod extends Mod {
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Configuration // Configuration
@@ -51,7 +51,7 @@ public class NametagsFeature extends Mod {
// Constructor // Constructor
// --------------------------------------------------------------- // ---------------------------------------------------------------
public NametagsFeature() { public NametagsMod() {
super( super(
new ModSpec("Nametags", "nametags") new ModSpec("Nametags", "nametags")
.description("Allows you to modify entity nametags") .description("Allows you to modify entity nametags")
@@ -130,7 +130,7 @@ public class NametagsFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -6,17 +6,17 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec; 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 * inside a mixin. This class owns the configuration and provides
* static query methods the mixin calls. * static query methods the mixin calls.
*/ */
public class NoFogFeature extends Mod { public class NoFogMod extends Mod {
private static final BoolProperty enabled = Property.bool(false); private static final BoolProperty enabled = Property.bool(false);
public NoFogFeature() { public NoFogMod() {
super( super(
new ModSpec("No Fog", "nofog") new ModSpec("No Fog", "nofog")
.description("Stops fog from rendering") .description("Stops fog from rendering")
@@ -31,7 +31,7 @@ public class NoFogFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -11,15 +11,15 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; 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. * 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 BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight()); private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
public PingFeature() { public PingMod() {
super( super(
new ModSpec("Ping Display", "ping") new ModSpec("Ping Display", "ping")
.description("Displays ping to the server") .description("Displays ping to the server")
@@ -30,7 +30,7 @@ public class PingFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -54,7 +54,7 @@ public class PingFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -13,10 +13,10 @@ import org.saturnclient.ui.RenderScope;
import org.saturnclient.ui.resources.Fonts; 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}. * 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 BoolProperty enabled = Property.bool(false);
private static final SelectProperty axis = Property.select(1, "Absolute", "Horizontal", "Vertical"); 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; private double cachedSpeed = 0.0;
public SpeedometerFeature() { public SpeedometerMod() {
super( super(
new ModSpec("Speedometer", "speed") new ModSpec("Speedometer", "speed")
.description("Displays your current movement speed") .description("Displays your current movement speed")
@@ -40,7 +40,7 @@ public class SpeedometerFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -89,7 +89,7 @@ public class SpeedometerFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -14,7 +14,7 @@ import org.saturnclient.mod.ModSpec;
import org.saturnclient.ui.RenderScope; 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. * a HUD overlay.
* *
* The effect list is supplied by the platform through an interface * 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} * Until that is wired up, the existing {@link StatusEffectsInterface}
* bridge is used, accessed via {@link ModuleProvider}. * 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); public static final BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, 0); private static final ModLayout layout = new ModLayout(60, 0);
public StatusEffectsFeature() { public StatusEffectsMod() {
super( super(
new ModSpec("Status Effects", "effect") new ModSpec("Status Effects", "effect")
.description("Displays active status effects") .description("Displays active status effects")
@@ -38,7 +38,7 @@ public class StatusEffectsFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -87,7 +87,7 @@ public class StatusEffectsFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -10,7 +10,7 @@ import org.saturnclient.mod.ModLayout;
import org.saturnclient.mod.ModSpec; 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. * elapsed real time between consecutive world-time packets.
* *
* TPS calculation is event-driven: the networking layer (or mixin) * 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 * arrives. No ModuleProvider is required because there is no
* per-frame polling of the engine. * 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 BoolProperty enabled = Property.bool(false);
private static final ModLayout layout = new ModLayout(60, Fonts.getHeight()); private static final ModLayout layout = new ModLayout(60, Fonts.getHeight());
@@ -44,7 +44,7 @@ public class TpsFeature extends Mod implements HudMod {
// Constructor // Constructor
// --------------------------------------------------------------- // ---------------------------------------------------------------
public TpsFeature() { public TpsMod() {
super( super(
new ModSpec("TPS Display", "tps") new ModSpec("TPS Display", "tps")
.description("Displays the server's ticks per second") .description("Displays the server's ticks per second")
@@ -98,7 +98,7 @@ public class TpsFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// HudFeature // HudMod
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -122,7 +122,7 @@ public class TpsFeature extends Mod implements HudMod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -9,14 +9,14 @@ import org.saturnclient.mod.Mod;
import org.saturnclient.mod.ModSpec; 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. * optical-zoom effect.
* *
* The FOV override is applied inside a mixin that polls * The FOV override is applied inside a mixin that polls
* {@link #shouldZoom()} and {@link #getZoomLevel()} each frame. * {@link #shouldZoom()} and {@link #getZoomLevel()} each frame.
* No ModuleProvider is needed — there is no per-tick engine query. * 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 enabled = Property.bool(false);
private static final BoolProperty toggle = 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). */ /** Whether zoom is currently active (read by the FOV mixin). */
public static boolean isZooming = false; public static boolean isZooming = false;
public ZoomFeature() { public ZoomMod() {
super( super(
new ModSpec("Zoom", "zoom") new ModSpec("Zoom", "zoom")
.description("Zoom in for a closer view") .description("Zoom in for a closer view")
@@ -39,7 +39,7 @@ public class ZoomFeature extends Mod {
} }
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Feature contract // Mod contract
// --------------------------------------------------------------- // ---------------------------------------------------------------
@Override @Override
@@ -30,7 +30,7 @@ import org.saturnclient.ui.resources.Fonts;
public class ConfigEditor extends SaturnScreen { public class ConfigEditor extends SaturnScreen {
private ConfigManager config; private ConfigManager config;
private HudMod hudFeature; private HudMod hudMod;
private HudModPreview preview; private HudModPreview preview;
public ConfigEditor(ConfigManager config) { public ConfigEditor(ConfigManager config) {
@@ -39,11 +39,11 @@ public class ConfigEditor extends SaturnScreen {
this.config = config; this.config = config;
} }
public ConfigEditor(ConfigManager config, HudMod hudFeature) { public ConfigEditor(ConfigManager config, HudMod hudMod) {
super("Config Editor"); super("Config Editor");
this.config = config; this.config = config;
this.hudFeature = hudFeature; this.hudMod = hudMod;
} }
@Override @Override
@@ -57,8 +57,8 @@ public class ConfigEditor extends SaturnScreen {
int scrollWidth = 480 + 10 + (g * 2) + (p * 2); int scrollWidth = 480 + 10 + (g * 2) + (p * 2);
if (this.hudFeature != null) { if (this.hudMod != null) {
this.preview = new HudModPreview(this.hudFeature); this.preview = new HudModPreview(this.hudMod);
} }
draw(scroll.dimensions(scrollWidth, 350).center(width, height)); draw(scroll.dimensions(scrollWidth, 350).center(width, height));
@@ -160,7 +160,7 @@ public class ConfigEditor extends SaturnScreen {
@Override @Override
public void render(RenderScope renderScope, int mouseX, int mouseY, float delta, long elapsed) { public void render(RenderScope renderScope, int mouseX, int mouseY, float delta, long elapsed) {
if (this.preview != null) { if (this.preview != null) {
ModLayout layout = hudFeature.getDimensions(); ModLayout layout = hudMod.getDimensions();
draw(this.preview draw(this.preview
.dimensions(layout.width, (int) (layout.height * layout.scale.value * 2.0f)) .dimensions(layout.width, (int) (layout.height * layout.scale.value * 2.0f))
.scale(1.0f) // Because the centering won't work properly .scale(1.0f) // Because the centering won't work properly