Removed old module logic
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.common.ref.game.ItemStackRef;
|
||||
import org.saturnclient.feature.features.featuresinterfaces.ArmorDisplayInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
|
||||
public class ArmorDisplayFabric implements ArmorDisplayInterface {
|
||||
|
||||
private ItemStackRef get(EquipmentSlot slot) {
|
||||
return (ItemStackRef) (Object) MinecraftClient.getInstance().player.getEquippedStack(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getMainHand() {
|
||||
return get(EquipmentSlot.MAINHAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getHelmet() {
|
||||
return get(EquipmentSlot.HEAD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getChestplate() {
|
||||
return get(EquipmentSlot.CHEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getLeggings() {
|
||||
return get(EquipmentSlot.LEGS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getBoots() {
|
||||
return get(EquipmentSlot.FEET);
|
||||
}
|
||||
|
||||
// Dummy items
|
||||
|
||||
@Override
|
||||
public ItemStackRef getDummyMainHand() {
|
||||
return (ItemStackRef) (Object) new ItemStack(Items.DIAMOND_SWORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getDummyHelmet() {
|
||||
return (ItemStackRef) (Object) new ItemStack(Items.DIAMOND_HELMET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getDummyChestplate() {
|
||||
return (ItemStackRef) (Object) new ItemStack(Items.DIAMOND_CHESTPLATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getDummyLeggings() {
|
||||
return (ItemStackRef) (Object) new ItemStack(Items.DIAMOND_LEGGINGS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStackRef getDummyBoots() {
|
||||
return (ItemStackRef) (Object) new ItemStack(Items.DIAMOND_BOOTS);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.AutoSprintInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class AutoSprintFabric implements AutoSprintInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public boolean hasPlayer() {
|
||||
return mc.player != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNetwork() {
|
||||
return mc.getNetworkHandler() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isForwardPressed() {
|
||||
return mc.options.forwardKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBackPressed() {
|
||||
return mc.options.backKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSneaking() {
|
||||
return mc.player.isSneaking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasHorizontalCollision() {
|
||||
return mc.player.horizontalCollision;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsingItem() {
|
||||
return mc.player.isUsingItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSprinting(boolean sprinting) {
|
||||
mc.player.setSprinting(sprinting);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.CoordinatesInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class CoordinatesFabric implements CoordinatesInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public int getPlayerX() {
|
||||
Vec3d pos = mc.player.getPos();
|
||||
return (int) pos.x;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlayerY() {
|
||||
Vec3d pos = mc.player.getPos();
|
||||
return (int) pos.y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlayerZ() {
|
||||
Vec3d pos = mc.player.getPos();
|
||||
return (int) pos.z;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.CrosshairInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class CrosshairFabric implements CrosshairInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public boolean isTargetingLivingEntity() {
|
||||
|
||||
Entity entity = mc.targetedEntity;
|
||||
|
||||
return entity != null && entity.isAlive();
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.DayCounterInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class DayCounterFabric implements DayCounterInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public long getDay() {
|
||||
if (mc.world == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mc.world.getTimeOfDay() / 24000L;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.FpsInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class FpsFabric implements FpsInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public int getFps() {
|
||||
return mc.getCurrentFps();
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.FreelookInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.option.Perspective;
|
||||
|
||||
public class FreelookFabric implements FreelookInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public boolean isFirstPerson() {
|
||||
return mc.options.getPerspective() == Perspective.FIRST_PERSON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFirstPerson() {
|
||||
mc.options.setPerspective(Perspective.FIRST_PERSON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThirdPersonBack() {
|
||||
mc.options.setPerspective(Perspective.THIRD_PERSON_BACK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.HealthDisplayInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class HealthDisplayFabric implements HealthDisplayInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public float getPlayerHealth() {
|
||||
if (mc.player == null) {
|
||||
return 0f;
|
||||
}
|
||||
|
||||
return mc.player.getHealth();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.KeystrokesInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class KeystrokesFabric implements KeystrokesInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public boolean isForwardPressed() {
|
||||
return mc.options.forwardKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBackPressed() {
|
||||
return mc.options.backKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLeftPressed() {
|
||||
return mc.options.leftKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRightPressed() {
|
||||
return mc.options.rightKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJumpPressed() {
|
||||
return mc.options.jumpKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAttackPressed() {
|
||||
return mc.options.attackKey.isPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsePressed() {
|
||||
return mc.options.useKey.isPressed();
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.NametagsInterface;
|
||||
import org.saturnclient.modules.HealthRenderState;
|
||||
|
||||
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class NametagsFabric implements NametagsInterface {
|
||||
|
||||
public static class EntityStateImpl implements EntityState {
|
||||
|
||||
private final LivingEntityRenderState state;
|
||||
|
||||
public EntityStateImpl(LivingEntityRenderState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCustomName() {
|
||||
Text name = state.customName;
|
||||
return name != null ? name.getString() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHealth() {
|
||||
if (!(state instanceof HealthRenderState hrs))
|
||||
return 0.0f;
|
||||
|
||||
return hrs.saturn$getHealth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxHealth() {
|
||||
if (!(state instanceof HealthRenderState hrs))
|
||||
return 0.0f;
|
||||
|
||||
return hrs.saturn$getMaxHealth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getEntityType() {
|
||||
if (!(state instanceof HealthRenderState hrs))
|
||||
return null;
|
||||
|
||||
return hrs.saturn$getEntityType();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.PingInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
|
||||
public class PingFabric implements PingInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public int getPing() {
|
||||
if (mc.player == null || mc.getNetworkHandler() == null)
|
||||
return 0;
|
||||
ClientPlayNetworkHandler handler = mc.getNetworkHandler();
|
||||
if (handler.getPlayerListEntry(mc.player.getUuid()) == null)
|
||||
return 0;
|
||||
return handler.getPlayerListEntry(mc.player.getUuid()).getLatency();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import org.saturnclient.feature.features.featuresinterfaces.SpeedometerInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class SpeedometerFabric implements SpeedometerInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public Velocity getVelocity() {
|
||||
Entity entity = mc.player.getVehicle() != null ? mc.player.getVehicle() : mc.player;
|
||||
return new Velocity(entity.getVelocity().x, entity.getVelocity().y, entity.getVelocity().z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnGround() {
|
||||
Entity entity = mc.player.getVehicle() != null ? mc.player.getVehicle() : mc.player;
|
||||
return entity.isOnGround();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package org.saturnclient.impl.modules;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.saturnclient.common.ref.asset.SpriteRef;
|
||||
import org.saturnclient.feature.features.featuresinterfaces.StatusEffectsInterface;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.StatusEffectSpriteManager;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
|
||||
public class StatusEffectsFabric implements StatusEffectsInterface {
|
||||
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
@Override
|
||||
public List<Effect> getActiveEffects() {
|
||||
StatusEffectSpriteManager manager = mc.getStatusEffectSpriteManager();
|
||||
return mc.player.getStatusEffects().stream()
|
||||
.filter(StatusEffectInstance::shouldShowIcon)
|
||||
.map(se -> new Effect(
|
||||
(SpriteRef) manager.getSprite(se.getEffectType()),
|
||||
se.getDuration() / 20,
|
||||
se.isInfinite(),
|
||||
se.shouldShowIcon(),
|
||||
"Infinite"))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Effect> getDummyEffects() {
|
||||
return Arrays.asList(
|
||||
new Effect(null, 600, false, true, "Infinite"),
|
||||
new Effect(null, 600, false, true, "Infinite"));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,22 @@
|
||||
package org.saturnclient.modules;
|
||||
|
||||
import org.saturnclient.common.module.EntityModule.EntityType;
|
||||
import org.saturnclient.common.module.EntityModule;
|
||||
|
||||
/**
|
||||
* Mixed into {@link net.minecraft.client.render.entity.state.LivingEntityRenderState}
|
||||
* by {@link org.saturnclient.modules.mixins.LivingEntityRenderStateMixin}.
|
||||
*
|
||||
* Carries the health snapshot and entity classification that
|
||||
* {@link org.saturnclient.modules.mixins.NametagsMixin} needs without
|
||||
* accessing the live entity during rendering.
|
||||
*/
|
||||
public interface HealthRenderState {
|
||||
float saturn$getHealth();
|
||||
|
||||
float saturn$getHealth();
|
||||
float saturn$getMaxHealth();
|
||||
|
||||
void saturn$setHealth(float health, float maxHealth);
|
||||
|
||||
EntityType saturn$getEntityType();
|
||||
|
||||
void saturn$setEntityType(EntityType type);
|
||||
EntityModule.EntityType saturn$getEntityType();
|
||||
void saturn$setEntityType(EntityModule.EntityType type);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package org.saturnclient.modules.mixins;
|
||||
|
||||
import org.saturnclient.common.module.EntityModule;
|
||||
|
||||
/**
|
||||
* Mixed into {@link net.minecraft.client.render.entity.state.LivingEntityRenderState}
|
||||
* by {@link org.saturnclient.modules.mixins.LivingEntityRenderStateMixin}.
|
||||
*
|
||||
* Carries the health snapshot and entity classification that
|
||||
* {@link org.saturnclient.modules.mixins.NametagsMixin} needs without
|
||||
* accessing the live entity during rendering.
|
||||
*/
|
||||
public interface HealthRenderState {
|
||||
|
||||
float saturn$getHealth();
|
||||
float saturn$getMaxHealth();
|
||||
|
||||
void saturn$setHealth(float health, float maxHealth);
|
||||
|
||||
EntityModule.EntityType saturn$getEntityType();
|
||||
void saturn$setEntityType(EntityModule.EntityType type);
|
||||
}
|
||||
Reference in New Issue
Block a user