Refactored all the common/module to feature
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.feature.PlayerFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.common.module.PlayerModule;
|
||||
import org.saturnclient.common.ref.game.ItemStackRef;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
@@ -15,7 +15,7 @@ import org.saturnclient.ui.RenderScope;
|
||||
* 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}.
|
||||
* Engine access is provided exclusively through {@link FeatureProvider}.
|
||||
*/
|
||||
public class ArmorDisplayMod extends Mod implements HudMod {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ArmorDisplayMod extends Mod implements HudMod {
|
||||
|
||||
@Override
|
||||
public void renderHud(RenderScope scope) {
|
||||
PlayerModule player = Providers.module.player();
|
||||
PlayerFeature player = Providers.module.player();
|
||||
renderArmor(scope,
|
||||
player.getMainHand(),
|
||||
player.getHelmet(),
|
||||
@@ -51,7 +51,7 @@ public class ArmorDisplayMod extends Mod implements HudMod {
|
||||
|
||||
@Override
|
||||
public void renderDummy(RenderScope scope) {
|
||||
PlayerModule player = Providers.module.player();
|
||||
PlayerFeature player = Providers.module.player();
|
||||
renderArmor(scope,
|
||||
player.getDummyMainHand(),
|
||||
player.getDummyHelmet(),
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.feature.NetworkFeature;
|
||||
import org.saturnclient.common.feature.PlayerFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
import org.saturnclient.mod.Mod;
|
||||
import org.saturnclient.mod.ModSpec;
|
||||
import org.saturnclient.common.module.NetworkModule;
|
||||
import org.saturnclient.common.module.PlayerModule;
|
||||
|
||||
/**
|
||||
* AutoSprintMod automatically enables sprinting whenever the
|
||||
@@ -31,8 +31,8 @@ public class AutoSprintMod extends Mod {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
PlayerModule player = Providers.module.player();
|
||||
NetworkModule network = Providers.module.network();
|
||||
PlayerFeature player = Providers.module.player();
|
||||
NetworkFeature network = Providers.module.network();
|
||||
|
||||
if (!player.hasPlayer() || !network.hasNetwork()) {
|
||||
return;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.feature.RenderFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
import org.saturnclient.mod.Mod;
|
||||
import org.saturnclient.mod.ModSpec;
|
||||
import org.saturnclient.common.module.RenderModule;
|
||||
import org.saturnclient.ui.RenderScope;
|
||||
import org.saturnclient.ui.resources.Textures;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CrosshairMod extends Mod {
|
||||
return;
|
||||
}
|
||||
|
||||
RenderModule render = Providers.module.render();
|
||||
RenderFeature render = Providers.module.render();
|
||||
int x = (render.getScaledWindowWidth() - CROSSHAIR_SIZE) / 2;
|
||||
int y = (render.getScaledWindowHeight() - CROSSHAIR_SIZE) / 2;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.module.WorldModule;
|
||||
import org.saturnclient.common.feature.WorldFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
@@ -13,7 +13,7 @@ import org.saturnclient.ui.resources.Fonts;
|
||||
|
||||
/**
|
||||
* 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 WorldFeature}.
|
||||
*/
|
||||
public class DayCounterMod extends Mod implements HudMod {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.module.RenderModule;
|
||||
import org.saturnclient.common.feature.RenderFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
@@ -13,7 +13,7 @@ import org.saturnclient.ui.resources.Fonts;
|
||||
|
||||
/**
|
||||
* 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 RenderFeature} rather than cached in the feature.
|
||||
*/
|
||||
public class FpsMod extends Mod implements HudMod {
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ import org.saturnclient.config.property.KeybindingProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
import org.saturnclient.mod.Mod;
|
||||
import org.saturnclient.mod.ModSpec;
|
||||
import org.saturnclient.common.module.RenderModule;
|
||||
import org.saturnclient.common.feature.RenderFeature;
|
||||
import org.saturnclient.common.provider.GLFWProvider;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Camera perspective is controlled through {@link RenderFeature} so
|
||||
* that the feature itself contains no direct Minecraft API calls.
|
||||
*/
|
||||
public class FreelookMod extends Mod {
|
||||
@@ -75,7 +75,7 @@ public class FreelookMod extends Mod {
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
private void startFreelook() {
|
||||
RenderModule render = Providers.module.render();
|
||||
RenderFeature render = Providers.module.render();
|
||||
wasFirstPerson = render.isFirstPerson();
|
||||
render.setThirdPersonBack();
|
||||
isFreeLooking = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.feature.PlayerFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.ColorProperty;
|
||||
@@ -8,7 +9,6 @@ import org.saturnclient.mod.HudMod;
|
||||
import org.saturnclient.mod.Mod;
|
||||
import org.saturnclient.mod.ModLayout;
|
||||
import org.saturnclient.mod.ModSpec;
|
||||
import org.saturnclient.common.module.PlayerModule;
|
||||
import org.saturnclient.ui.RenderScope;
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ public class KeystrokesMod extends Mod implements HudMod {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
PlayerModule player = Providers.module.player();
|
||||
PlayerFeature player = Providers.module.player();
|
||||
w = player.isForwardPressed();
|
||||
a = player.isLeftPressed();
|
||||
s = player.isBackPressed();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.module.EntityModule;
|
||||
import org.saturnclient.common.feature.EntityFeature;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
import org.saturnclient.config.property.SelectProperty;
|
||||
@@ -13,10 +13,10 @@ import org.saturnclient.mod.ModSpec;
|
||||
* Actual rendering is injected via a mixin; this class owns the
|
||||
* configuration and exposes two static query methods the mixin uses:
|
||||
* {@link #shouldReplaceName()} and
|
||||
* {@link #getNametagString(EntityModule.EntityState)}.
|
||||
* {@link #getNametagString(EntityFeature.EntityState)}.
|
||||
*
|
||||
* No ModuleProvider is required here because the mixin passes the
|
||||
* already-resolved {@link EntityModule.EntityState} directly.
|
||||
* already-resolved {@link EntityFeature.EntityState} directly.
|
||||
*/
|
||||
public class NametagsMod extends Mod {
|
||||
|
||||
@@ -83,7 +83,7 @@ public class NametagsMod extends Mod {
|
||||
* Builds the replacement nametag string for the given entity state,
|
||||
* or {@code null} if this entity should not have its tag replaced.
|
||||
*/
|
||||
public static String getNametagString(EntityModule.EntityState state) {
|
||||
public static String getNametagString(EntityFeature.EntityState state) {
|
||||
if (state.getCustomName() == null)
|
||||
return null;
|
||||
if (!healthDisplay.value)
|
||||
@@ -92,14 +92,14 @@ public class NametagsMod extends Mod {
|
||||
float health = state.getHealth();
|
||||
float maxHealth = state.getMaxHealth();
|
||||
|
||||
EntityModule.EntityType type = state.getEntityType();
|
||||
if (type == EntityModule.EntityType.PASSIVE && !passive.value)
|
||||
EntityFeature.EntityType type = state.getEntityType();
|
||||
if (type == EntityFeature.EntityType.PASSIVE && !passive.value)
|
||||
return null;
|
||||
if (type == EntityModule.EntityType.HOSTILE && !hostile.value)
|
||||
if (type == EntityFeature.EntityType.HOSTILE && !hostile.value)
|
||||
return null;
|
||||
if (type == EntityModule.EntityType.PLAYER && !players.value)
|
||||
if (type == EntityFeature.EntityType.PLAYER && !players.value)
|
||||
return null;
|
||||
if (type == EntityModule.EntityType.OTHER)
|
||||
if (type == EntityFeature.EntityType.OTHER)
|
||||
return null;
|
||||
|
||||
if (health < 0f || maxHealth < 0f || health > maxHealth)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.saturnclient.mod.mods;
|
||||
|
||||
import org.saturnclient.common.feature.PlayerFeature;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
@@ -8,13 +9,12 @@ import org.saturnclient.mod.HudMod;
|
||||
import org.saturnclient.mod.Mod;
|
||||
import org.saturnclient.mod.ModLayout;
|
||||
import org.saturnclient.mod.ModSpec;
|
||||
import org.saturnclient.common.module.PlayerModule;
|
||||
import org.saturnclient.ui.RenderScope;
|
||||
import org.saturnclient.ui.resources.Fonts;
|
||||
|
||||
/**
|
||||
* 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 PlayerFeature}.
|
||||
*/
|
||||
public class SpeedometerMod extends Mod implements HudMod {
|
||||
|
||||
@@ -45,8 +45,8 @@ public class SpeedometerMod extends Mod implements HudMod {
|
||||
|
||||
@Override
|
||||
public void renderHud(RenderScope scope) {
|
||||
PlayerModule player = Providers.module.player();
|
||||
PlayerModule.Velocity v = player.getVelocity();
|
||||
PlayerFeature player = Providers.module.player();
|
||||
PlayerFeature.Velocity v = player.getVelocity();
|
||||
boolean onGround = player.isOnGround();
|
||||
|
||||
double effectiveY = onGround ? 0.0 : v.y;
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.saturnclient.mod.mods;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.saturnclient.common.provider.ModuleProvider;
|
||||
import org.saturnclient.common.provider.FeatureProvider;
|
||||
import org.saturnclient.common.provider.Providers;
|
||||
import org.saturnclient.common.ref.game.EffectRef;
|
||||
import org.saturnclient.config.property.BoolProperty;
|
||||
@@ -20,7 +20,7 @@ import org.saturnclient.ui.RenderScope;
|
||||
* The effect list is supplied by the platform through an interface
|
||||
* returned by a future {@code PlayerModule#getActiveEffects()} call.
|
||||
* Until that is wired up, the existing {@link StatusEffectsInterface}
|
||||
* bridge is used, accessed via {@link ModuleProvider}.
|
||||
* bridge is used, accessed via {@link FeatureProvider}.
|
||||
*/
|
||||
public class StatusEffectsMod extends Mod implements HudMod {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user