Compare commits

...
2 Commits
Author SHA1 Message Date
retuci0 86594f1ca3 v2.9 2026-01-18 22:53:21 +01:00
retuci0 f074f05c51 v2.8 2026-01-17 17:12:54 +01:00
53 changed files with 1577 additions and 224 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# jenny's mod 2 100% real
mod para Minecraft Fabric 1.21.10 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
mod para Minecraft Fabric 1.21.11 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
## instalación
+15 -9
View File
@@ -1,23 +1,29 @@
# v2.7
# v2.9
## novedades
varios módulos que no quería añadir porque son cheats en toda regla, pero ya total, como la mayoría que he añadido hasta la fecha es baneable
### adiciones
- filtro por categoría de módulos en la barra de búsqueda
- categoría de movimiento
#### módulos nuevos:
- avioneta: vuela infinitamente usando el glitch de las elytras descubierto por Heppe, o al menos hasta que se te rompan las elytras
- triangulador de strongholds: usa geometría simple para calcular la intersección de las líneas creadas por los ojos de ender lanzados para obtener la posición aproximada de la stronghold más cercana
- discordrpc: personaliza la actividad de tu perfil de discord
- packetmine: mina usando paquetes, para minar más rápido o para evitar la animación de minado
- aliviar cpu: evita renderizar objetos en pantalla si la ventana no está seleccionada
- delfín: *ruidos de delfín*
- patinaje: esparce semen allá por donde pisas (haciéndolo más resbaladizo)
- jesús: hermano se cree Jesús (camina sobre el agua)
- info. de bloque: (muestra el contenido nbt de un bloque)
- estampaescrotos: mazo en esteroides
- tenedor mágico: hermano se cree Poseidón (tweaks a la propulsión acuática del tridente)
- elytras: vuela con las elytras (en vez de solo planear)
- barco volador: convierte tu bote de acacia en un caza militar
### arreglos / mejoras
- ahora se puede hacer ctrl + v para pegar en los ajustes de texto
- el color por defecto de la superposición de daño ya es el color principal del mod
- arreglado el elemento del HUD de rotación
- arreglado los marcos de ajustes de selección
- ahora puedes cambiar el título de la ventana en los ajustes del mod
## problemas reconocidos
+1 -1
View File
@@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT
fabric_api_version=0.140.2+1.21.11
mod_version=2.7
mod_version=2.9
maven_group=me.retucio
archives_base_name=sputnik
@@ -19,6 +19,7 @@ import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.client.HUD;
import me.retucio.sputnik.ui.hud.HudRenderer;
import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.hud.HudEditorScreen;
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
@@ -108,6 +109,8 @@ public class Sputnik implements ClientModInitializer {
HudEditorScreen.INSTANCE = new HudEditorScreen();
EVENT_BUS.post(new LoadClickGUIEvent());
mc.execute(HudRenderer::init);
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
EVENT_BUS.post(new ShutdownEvent());
}));
@@ -123,6 +126,7 @@ public class Sputnik implements ClientModInitializer {
}
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
mc.getWindow().setTitle(ClientSettingsFrame.guiSettings.windowTitle.getValue());
}
@@ -0,0 +1,27 @@
package me.retucio.sputnik.event;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.util.math.Vec3d;
public class BoatMoveEvent extends Event {
private final AbstractBoatEntity boat;
private Vec3d pos;
public BoatMoveEvent(AbstractBoatEntity boat, Vec3d pos) {
this.boat = boat;
this.pos = pos;
}
public AbstractBoatEntity getBoat() {
return boat;
}
public Vec3d getPos() {
return pos;
}
public void setPos(Vec3d pos) {
this.pos = pos;
}
}
@@ -0,0 +1,24 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
public class AttackBlockEvent extends Event {
private final BlockPos pos;
private final Direction dir;
public AttackBlockEvent(BlockPos pos, Direction dir) {
this.pos = pos;
this.dir = dir;
}
public BlockPos getPos() {
return pos;
}
public Direction getDir() {
return dir;
}
}
@@ -0,0 +1,43 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
public class BlockShapeEvent extends Event {
private BlockState state;
private BlockPos pos;
private VoxelShape shape;
public BlockShapeEvent(BlockState state, BlockPos pos, VoxelShape shape) {
this.state = state;
this.pos = pos;
this.setShape(shape);
}
public BlockState getState() {
return state;
}
public void setState(BlockState state) {
this.state = state;
}
public BlockPos getPos() {
return pos;
}
public void setPos(BlockPos pos) {
this.pos = pos;
}
public VoxelShape getShape() {
return shape;
}
public void setShape(VoxelShape shape) {
this.shape = shape;
}
}
@@ -0,0 +1,31 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.BoatMoveEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.movement.BoatFly;
import net.minecraft.entity.MovementType;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(AbstractBoatEntity.class)
public abstract class AbstractBoatEntityMixin {
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/AbstractBoatEntity;move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V"))
private void onMove(AbstractBoatEntity instance, MovementType movementType, Vec3d vec3d) {
BoatMoveEvent event = Sputnik.EVENT_BUS.post(new BoatMoveEvent(instance, vec3d));
if(!event.isCancelled()) instance.move(movementType, event.getPos());
}
@Inject(method = "updatePaddles", at = @At("HEAD"), cancellable = true)
private void onPaddle(CallbackInfo ci) {
if (ModuleManager.INSTANCE.getModuleByClass(BoatFly.class).isEnabled()) {
ci.cancel();
}
}
}
@@ -0,0 +1,33 @@
package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.BlockShapeEvent;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockCollisionSpliterator;
import net.minecraft.world.CollisionView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import static me.retucio.sputnik.Sputnik.mc;
@Mixin(BlockCollisionSpliterator.class)
public abstract class BlockCollisionSpliteratorMixin {
@WrapOperation(method = "computeNext", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ShapeContext;getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/CollisionView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;"))
private VoxelShape onGetBlockShape(ShapeContext instance, BlockState state, CollisionView collisionView, BlockPos pos, Operation<VoxelShape> original) {
VoxelShape shape = original.call(instance, state, collisionView, pos);
if (collisionView != mc.world) {
return shape;
}
BlockShapeEvent event = Sputnik.EVENT_BUS.post(new BlockShapeEvent(state, pos, shape));
return event.isCancelled() ? VoxelShapes.empty() : event.getShape();
}
}
@@ -1,12 +1,10 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.AttackEntityEvent;
import me.retucio.sputnik.event.events.BreakBlockEvent;
import me.retucio.sputnik.event.events.InteractEntityEvent;
import me.retucio.sputnik.event.events.PlaceBlockEvent;
import me.retucio.sputnik.event.events.*;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.player.FastUse;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
@@ -18,6 +16,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
@@ -29,6 +28,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
import static me.retucio.sputnik.Sputnik.mc;
@Mixin(ClientPlayerInteractionManager.class)
public abstract class ClientPlayerInteractionManagerMixin {
@@ -38,12 +38,15 @@ public abstract class ClientPlayerInteractionManagerMixin {
@Unique
Freecam freecam;
@Unique
FastUse fastUse;
@Inject(method = "<init>", at = @At("TAIL"))
private void getModules(MinecraftClient client, ClientPlayNetworkHandler networkHandler, CallbackInfo ci) {
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
}
@Inject(method = "breakBlock", at = @At("HEAD"), cancellable = true)
private void onBlockBreak(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
BreakBlockEvent event = EVENT_BUS.post(new BreakBlockEvent(pos));
@@ -57,6 +60,12 @@ public abstract class ClientPlayerInteractionManagerMixin {
if (event.isCancelled()) cir.cancel();
}
@Inject(method = "attackBlock", at = @At("HEAD"), cancellable = true)
private void onAttackBlock(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
AttackBlockEvent event = EVENT_BUS.post(new AttackBlockEvent(pos, direction));
if (event.isCancelled()) cir.cancel();
}
@Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
private void onEntityInteract(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
if (mc.player != player) return;
@@ -72,10 +81,8 @@ public abstract class ClientPlayerInteractionManagerMixin {
}
@Inject(method = "updateBlockBreakingProgress", at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;blockBreakingCooldown:I"))
@Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"))
private void modifyBlockBreakingCooldown(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
if (!fastUse.isEnabled() || !fastUse.mining.getValue()) return;
blockBreakingCooldown = fastUse.miningCooldown.getIntValue();
}
@@ -7,19 +7,23 @@ import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.camera.Freelook;
import me.retucio.sputnik.module.modules.camera.Rotations;
import me.retucio.sputnik.module.modules.misc.AntiInvis;
import me.retucio.sputnik.module.modules.movement.BoatFly;
import me.retucio.sputnik.module.modules.render.Nametags;
import net.minecraft.entity.*;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@@ -146,7 +150,16 @@ public abstract class EntityMixin {
// otros
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
public void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
private void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
if (ModuleManager.INSTANCE.getModuleByClass(AntiInvis.class).isEnabled()) cir.setReturnValue(false);
}
@SuppressWarnings("ConstantConditions")
@Inject(method = "getStepHeight", at = @At("RETURN"), cancellable = true)
private void modifyBoatStepHeight(CallbackInfoReturnable<Float> cir) {
BoatFly boatFly = ModuleManager.INSTANCE.getModuleByClass(BoatFly.class);
if (((Object) this) instanceof AbstractBoatEntity && boatFly.isEnabled()) {
cir.setReturnValue(boatFly.stepHeight.getFloatValue());
}
}
}
@@ -4,6 +4,7 @@ package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.GetFOVEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.misc.UnfocusedCpu;
import me.retucio.sputnik.module.modules.render.NoRender;
import me.retucio.sputnik.module.modules.camera.Zoom;
import me.retucio.sputnik.util.interfaces.IVec3d;
@@ -11,6 +12,7 @@ import me.retucio.sputnik.util.interfaces.IVec3d;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.BufferBuilderStorage;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.item.HeldItemRenderer;
import net.minecraft.entity.Entity;
@@ -22,6 +24,7 @@ import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
@@ -29,6 +32,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
import static me.retucio.sputnik.Sputnik.mc;
@Mixin(GameRenderer.class)
@@ -64,6 +68,12 @@ public abstract class GameRendererMixin {
return EVENT_BUS.post(new GetFOVEvent(original)).getFov();
}
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
private void avoidRenderingUnfocusedCpu(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) {
if (ModuleManager.INSTANCE.getModuleByClass(UnfocusedCpu.class).isEnabled() && !mc.isWindowFocused())
ci.cancel();
}
@Inject(method = "updateCrosshairTarget", at = @At("HEAD"), cancellable = true)
private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo ci) {
if ((freecam.isEnabled()) && client.getCameraEntity() != null && !freecamDone) {
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.player.ElytraBounce;
import me.retucio.sputnik.module.modules.player.Step;
import me.retucio.sputnik.module.modules.movement.ElytraBounce;
import me.retucio.sputnik.module.modules.movement.Step;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.sound.SoundCategory;
@@ -0,0 +1,39 @@
package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.movement.TridentBoost;
import net.minecraft.item.Item;
import net.minecraft.item.TridentItem;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
@Mixin(TridentItem.class)
public abstract class TridentItemMixin {
@ModifyArgs(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;addVelocity(DDD)V"))
private void modifyVelocity(Args args) {
TridentBoost tridentBoost = ModuleManager.INSTANCE.getModuleByClass(TridentBoost.class);
if (!tridentBoost.isEnabled()) return;
args.set(0, (double) args.get(0) * tridentBoost.multiplier.getValue());
args.set(1, (double) args.get(1) * tridentBoost.multiplier.getValue());
args.set(2, (double) args.get(2) * tridentBoost.multiplier.getValue());
}
@ModifyExpressionValue(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isTouchingWaterOrRain()Z"))
private boolean allowUseOutOfWaterPre(boolean original) {
TridentBoost tridentBoost = ModuleManager.INSTANCE.getModuleByClass(TridentBoost.class);
return (tridentBoost.outOfWater.getValue() && tridentBoost.isEnabled()) || original;
}
@ModifyExpressionValue(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isTouchingWaterOrRain()Z"))
private boolean allowUseOutOfWaterPost(boolean original) {
TridentBoost tridentBoost = ModuleManager.INSTANCE.getModuleByClass(TridentBoost.class);
return (tridentBoost.outOfWater.getValue() && tridentBoost.isEnabled()) || original;
}
}
@@ -0,0 +1,13 @@
package me.retucio.sputnik.mixin.accessor;
import net.minecraft.block.AbstractBlock;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(AbstractBlock.class)
public interface AbstractBlockAccessor {
@Mutable @Accessor("slipperiness")
void setSlipperiness(float slipperiness);
}
@@ -4,6 +4,7 @@ public enum Category {
PLAYER("jugador"),
WORLD("mundo"),
MOVEMENT("movimiento"),
CAMERA("cámara"),
RENDER("renderizado"),
@@ -6,6 +6,7 @@ import me.retucio.sputnik.module.modules.client.DiscordRPC;
import me.retucio.sputnik.module.modules.client.HUD;
import me.retucio.sputnik.module.modules.camera.*;
import me.retucio.sputnik.module.modules.misc.*;
import me.retucio.sputnik.module.modules.movement.*;
import me.retucio.sputnik.module.modules.network.*;
import me.retucio.sputnik.module.modules.player.*;
import me.retucio.sputnik.module.modules.render.*;
@@ -13,6 +14,7 @@ import me.retucio.sputnik.module.modules.render.CritsPlus;
import me.retucio.sputnik.module.modules.world.*;
import me.retucio.sputnik.util.MiscUtil;
import java.awt.*;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Comparator;
@@ -30,60 +32,16 @@ public class ModuleManager {
addModules();
}
// por orden alfabético y todo, flipas
private void addModules() {
modules.add(new AntiInvis());
modules.add(new AnvilFont());
modules.add(new AttributeSwapper());
modules.add(new AutoSign());
modules.add(new BlockESP());
modules.add(new BlockOutline());
modules.add(new BossbarStack());
modules.add(new BreakingProgress());
modules.add(new BungeecordSpoofer());
modules.add(new Capes());
modules.add(new ChatPlus());
modules.add(new ColoredSigns());
modules.add(new CritsPlus());
modules.add(new DamageOverlay());
modules.add(new DiscordRPC());
modules.add(new ElytraBounce());
modules.add(new FakePlayer());
modules.add(new FastUse());
modules.add(new Fonts());
modules.add(new Freecam());
modules.add(new Freelook());
modules.add(new Fullbright());
modules.add(new GlintPlus());
modules.add(new HandView());
modules.add(new Headhitters());
modules.add(new HUD());
modules.add(new InfiniteElytra());
modules.add(new InventoryPlus());
modules.add(new LightOverlay());
modules.add(new LogoutSpots());
modules.add(new Nametags());
modules.add(new NoMiningInterruptions());
modules.add(new NoRender());
modules.add(new Offhand());
modules.add(new PacketDelay());
modules.add(new Particles());
modules.add(new PerspectivePlus());
modules.add(new PortalGUI());
modules.add(new Racist());
modules.add(new Reconnect());
modules.add(new ReverseStep());
modules.add(new Rotations());
modules.add(new RPackBypass());
modules.add(new SafeWalk());
modules.add(new ScreenshotPlus());
modules.add(new ShulkerPeek());
modules.add(new Step());
modules.add(new StrongholdTriangulator());
modules.add(new TimeChanger());
modules.add(new UIMove());
modules.add(new WarnLowDurability());
modules.add(new Zoom());
// añadir los módulos
addCamera();
addClient();
addMisc();
addMovement();
addNetwork();
addPlayer();
addRender();
addWorld();
modules.sort(Comparator.comparing(module -> MiscUtil.removeAccentMarks(module.getName().toLowerCase())));
@@ -98,6 +56,102 @@ public class ModuleManager {
}
}
private void add(Module module) {
modules.add(module);
}
private void addCamera() {
add(new Freecam());
add(new Freelook());
add(new Fullbright());
add(new PerspectivePlus());
add(new Rotations());
add(new Zoom());
}
private void addClient() {
add(new DiscordRPC());
add(new HUD());
}
private void addMisc() {
add(new AntiInvis());
add(new AnvilFont());
add(new BossbarStack());
add(new ChatPlus());
add(new FakePlayer());
add(new ScreenshotPlus());
add(new ShulkerPeek());
add(new UnfocusedCpu());
}
private void addMovement() {
add(new BoatFly());
add(new Dolphin());
add(new ElytraBounce());
add(new ElytraFly());
add(new Headhitters());
add(new InfiniteElytra());
add(new Jesus());
add(new ReverseStep());
add(new SafeWalk());
add(new Slippy());
add(new Step());
add(new TridentBoost());
}
private void addNetwork() {
add(new BungeecordSpoofer());
add(new LogoutSpots());
add(new PacketDelay());
add(new PacketMine());
add(new Reconnect());
add(new RPackBypass());
}
private void addPlayer() {
add(new AttributeSwapper());
add(new Capes());
add(new FastUse());
add(new HandView());
add(new InventoryPlus());
add(new MaceKill());
add(new Offhand());
add(new PortalGUI());
add(new UIMove());
add(new WarnLowDurability());
}
private void addRender() {
add(new BlockESP());
add(new BlockOutline());
add(new BreakingProgress());
add(new CritsPlus());
add(new DamageOverlay());
add(new Fonts());
add(new GlintPlus());
add(new Nametags());
add(new NoRender());
add(new Particles());
}
private void addWorld() {
add(new AutoSign());
add(new BlockInfo());
add(new ColoredSigns());
add(new LightOverlay());
add(new NoMiningInterruptions());
add(new Racist());
add(new StrongholdTriangulator());
add(new TimeChanger());
}
// para obtener módulos más fácilmente (por nombre, clase, o la lista completa)
public List<Module> getModules() {
@@ -38,8 +38,8 @@ public class DiscordRPC extends Module {
));
public StringSetting startTimestamp = sgGeneral.add(new StringSetting(
"sello de tiempo", "sello de tiempo del comienzo de la actividad, siguiendo el unix epoch (. para ahora)",
".",
"sello de tiempo", "sello de tiempo del comienzo de la actividad, siguiendo el unix epoch (dejar vacío para ahora)",
"",
20
));
@@ -124,6 +124,8 @@ public class DiscordRPC extends Module {
"personaliza la actividad de tu perfil en dishkor",
Category.CLIENT);
rpc.setDebugMode(false);
for (Setting<?> s : getSettings()) {
s.onUpdate(v -> update());
}
@@ -202,13 +204,15 @@ public class DiscordRPC extends Module {
}
private long getTimestamp() {
long timestamp = System.currentTimeMillis();
if (!startTimestamp.getValue().equals(".")) {
long timestamp;
if (startTimestamp.getValue().trim().isEmpty()) {
timestamp = System.currentTimeMillis();
} else {
try {
timestamp = Long.parseLong(startTimestamp.getValue());
} catch (NumberFormatException e) {
ChatUtil.error("introduce un NÚMERO (o .)");
ChatUtil.error("introduce un NÚMERO (o déjalo vacío)");
timestamp = System.currentTimeMillis();
}
}
@@ -1,5 +1,6 @@
package me.retucio.sputnik.module.modules.client;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.TickEvent;
@@ -28,25 +29,76 @@ public class GUI extends Module {
SettingGroup sgChat = addSg(new SettingGroup("chat", true));
SettingGroup sgMisc = addSg(new SettingGroup("misc.", true));
public ColorSetting color = sgGeneral.add(new ColorSetting("color", "color principal de la interfaz y el mod",
new Color(70, 20, 210, 230), false));
public ColorSetting color = sgGeneral.add(new ColorSetting(
"color",
"color principal de la interfaz y el mod",
new Color(70, 20, 210, 230),
false
));
// números negativos para deslizamiento inverso, 0 para desactivar
public NumberSetting scrollSens = sgWidgets.add(new NumberSetting("sensibilidad del scroll", "qué tan sensible es la interfaz a la rueda del ratón",
5, -15, 15, 0.5));
public BooleanSetting scrollBar = sgWidgets.add(new BooleanSetting("barra de desplazamiento", "renderizar una barra de desplazamiento a la derecha de la interfaz", true));
public NumberSetting scrollSens = sgWidgets.add(new NumberSetting(
"sensibilidad del scroll",
"qué tan sensible es la interfaz a la rueda del ratón",
5,
-15,
15,
0.5
));
public BooleanSetting scrollBar = sgWidgets.add(new BooleanSetting(
"barra de desplazamiento",
"renderizar una barra de desplazamiento a la derecha de la interfaz",
true
));
public BooleanSetting searchBar = sgWidgets.add(new BooleanSetting("barra de búsqueda", "renderizar una barra de búsqueda que filtra resultados en todos los marcos abiertos", true));
public BooleanSetting matchCase = sgWidgets.add(new BooleanSetting("distinguir mayúsculas", "la búsqueda es sensible a mayúsculas y minúsculas", false));
public BooleanSetting searchBar = sgWidgets.add(new BooleanSetting(
"barra de búsqueda",
"renderizar una barra de búsqueda que filtra resultados en todos los marcos abiertos",
true
));
public BooleanSetting matchCase = sgWidgets.add(new BooleanSetting(
"distinguir mayúsculas",
"la búsqueda es sensible a mayúsculas y minúsculas",
false
));
// ^^^ no sé de qué sirve porque está todo en minúsculas pero bueno
public BooleanSetting blur = sgUi.add(new BooleanSetting("desenfoque", "desenfocar el fondo mientras la interfaz está abierta", true));
public StringSetting watermark = sgUi.add(new StringSetting("marca de agua", "marca de agua para interfaces (dejar vacío para desactivar)", me.retucio.sputnik.Sputnik.getVersionName(), 40));
public BooleanSetting blur = sgUi.add(new BooleanSetting(
"desenfoque",
"desenfocar el fondo mientras la interfaz está abierta",
true
));
public StringSetting watermark = sgUi.add(new StringSetting(
"marca de agua",
"marca de agua para interfaces (dejar vacío para desactivar)",
Sputnik.getVersionName(),
40
));
public StringSetting commandPrefix = sgChat.add(new StringSetting("prefijo", "prefijo de los comandos", "$", 10));
public StringSetting chatName = sgChat.add(new StringSetting("nombre", "qué nombre usar en notificaciones por el chat", "smegma", 20));
public StringSetting commandPrefix = sgChat.add(new StringSetting(
"prefijo",
"prefijo de los comandos",
"$",
10
));
public StringSetting chatName = sgChat.add(new StringSetting(
"nombre",
"qué nombre usar en notificaciones por el chat",
"smegma",
20
));
public BooleanSetting multipleKeybinds = sgMisc.add(new BooleanSetting("teclas multimódulo", "permitir asignar la misma tecla a más de un módulo", false));
public BooleanSetting multipleKeybinds = sgMisc.add(new BooleanSetting(
"teclas multimódulo",
"permitir asignar la misma tecla a más de un módulo o acción",
false
));
public StringSetting windowTitle = sgMisc.add(new StringSetting(
"título",
"título de la ventana",
Sputnik.getVersionName(),
50
));
public GUI() {
super("interfaz",
@@ -25,21 +25,92 @@ public class HUD extends Module {
SettingGroup sgElements = addSg(new SettingGroup("elementos", false));
// editor
public KeySetting editorKey = sgEditor.add(new KeySetting("tecla del editor", "tecla asignada al editor de elementos del hud", GLFW.GLFW_KEY_PAGE_UP));
public KeySetting editorKey = sgEditor.add(new KeySetting(
"tecla del editor",
"tecla asignada al editor de elementos del hud",
GLFW.GLFW_KEY_PAGE_UP
));
public BooleanSetting axialMovement = sgEditor.add(new BooleanSetting(
"movimiento axial",
"te permite mover los elementos sobre los ejes más fácilmente",
true
));
public NumberSetting axisOffset = sgEditor.add(new NumberSetting(
"offset de los ejes",
"offset a tener en cuenta al usar el movimiento axial",
10,
0,
50,
1
));
public BooleanSetting arrowMovement = sgEditor.add(new BooleanSetting(
"movimiento con flechas",
"te permite mover el elemento seleccionado con las teclas de las flechas",
true
));
public NumberSetting arrowOffset = sgEditor.add(new NumberSetting(
"cuánto mover con las flechas",
"cuántos píxeles mover el elemento seleccionado al usar las flechas",
2,
1,
20,
1
));
// ajustes
public ColorSetting color = sgDisplay.add(new ColorSetting("color", "color del texto de los elementos del HUD",
new Color(255, 255, 255, 255), false));
public BooleanSetting shadow = sgDisplay.add(new BooleanSetting("sombra", "texto con sombra", true));
public BooleanSetting showOnF3 = sgDisplay.add(new BooleanSetting("mostrar en F3", "renderizar HUD en el menú de debug", false));
public BooleanSetting showOnChat = sgDisplay.add(new BooleanSetting("mostrar en chat", "renderizar HUD en la pantalla del chat", false));
// renderizado
public ColorSetting color = sgDisplay.add(new ColorSetting(
"color",
"color del texto de los elementos del HUD",
new Color(255, 255, 255, 255), false)
);
public BooleanSetting shadow = sgDisplay.add(new BooleanSetting(
"sombra",
"texto con sombra",
true
));
public BooleanSetting showOnF3 = sgDisplay.add(new BooleanSetting(
"mostrar en F3",
"renderizar HUD en el menú de debug",
false
));
public BooleanSetting showOnChat = sgDisplay.add(new BooleanSetting(
"mostrar en chat",
"renderizar HUD en la pantalla del chat",
false
));
public NumberSetting timezone = sgElements.add(new NumberSetting("zona horaria", "zona horaria en UTC+n", 1, -6, 6, 1));
public EnumSetting<TimeFormat> timeFormat = sgElements.add(new EnumSetting<>("formato de la hora", "12h o 24h", TimeFormat.class, TimeFormat.TWENTY_FOUR_HOUR));
public StringSetting customText = sgElements.add(new StringSetting("texto custom", "marca de agua (dejar vacío para quitar)", "adolf jitler inshtagram feishbuc twiter", 40));
public EnumSetting<CoordsMode> coordsMode = sgElements.add(new EnumSetting<>("modo de coordenadas", "qué coordenadas mostrar", CoordsMode.class, CoordsMode.OVERWORLD));
public EnumSetting<Dynosaurs> dyno = sgElements.add(new EnumSetting<>("dinosaurio", "qué dinosaurio mostrar",
Dynosaurs.class, Dynosaurs.SPINOSAURUS));
// elementos
public NumberSetting timezone = sgElements.add(new NumberSetting(
"zona horaria",
"zona horaria en UTC+n",
1,
-6,
6,
1
));
public EnumSetting<TimeFormat> timeFormat = sgElements.add(new EnumSetting<>(
"formato de la hora",
"12h o 24h",
TimeFormat.class,
TimeFormat.TWENTY_FOUR_HOUR
));
public StringSetting customText = sgElements.add(new StringSetting(
"texto custom",
"marca de agua (dejar vacío para quitar)",
"adolf jitler inshtagram feishbuc twiter",
40
));
public EnumSetting<CoordsMode> coordsMode = sgElements.add(new EnumSetting<>(
"modo de coordenadas",
"qué coordenadas mostrar",
CoordsMode.class,
CoordsMode.OVERWORLD
));
public EnumSetting<Dynosaurs> dyno = sgElements.add(new EnumSetting<>(
"dinosaurio",
"qué dinosaurio mostrar",
Dynosaurs.class, Dynosaurs.SPINOSAURUS
));
public HUD() {
super("HUD",
@@ -48,6 +119,9 @@ public class HUD extends Module {
GLFW.GLFW_KEY_F12
);
axialMovement.onUpdate(v -> axisOffset.setVisible(v));
arrowMovement.onUpdate(v -> arrowOffset.setVisible(v));
dyno.onUpdate(v -> {
DynoElement element = (DynoElement) HudRenderer.getElement(DynoElement.class);
if (element != null) element.reloadTexture();
@@ -0,0 +1,11 @@
package me.retucio.sputnik.module.modules.misc;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
public class UnfocusedCpu extends Module {
public UnfocusedCpu() {
super("aliviar cpu", "evita renderizar objetos en pantalla si la ventana no está seleccionada", Category.MISC);
}
}
@@ -0,0 +1,91 @@
package me.retucio.sputnik.module.modules.movement;
import com.google.common.eventbus.Subscribe;
import me.retucio.sputnik.event.BoatMoveEvent;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.PacketEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.network.packet.s2c.play.VehicleMoveS2CPacket;
import net.minecraft.util.math.Vec3d;
public class BoatFly extends Module {
public NumberSetting speed = sgGeneral.add(new NumberSetting(
"velocidad horizontal",
"velocidad a la que moverse horizontalmente",
2,
0,
5,
0.1
));
public NumberSetting vSpeed = sgGeneral.add(new NumberSetting(
"velocidad vertical",
"velocidad a la que moverse verticalmente",
1,
0,
5,
0.1
));
public NumberSetting stepHeight = sgGeneral.add(new NumberSetting(
"altura de escalonado",
"como escalones pero pal barco",
0.5,
0,
1,
0.1
));
public BooleanSetting cancelPackets = sgGeneral.add(new BooleanSetting(
"cancelar paquetes",
"cancelar paquetes de movimiento del barco enviados por el servidor",
false
));
public BoatFly() {
super("barco volador", "convierte tu bote de acacia en un Lockheed F-117 Nighthawk", Category.MOVEMENT);
}
@SubscribeEvent
private void onBoatMove(BoatMoveEvent event) {
if (event.getBoat().getControllingPassenger() != mc.player) return;
event.getBoat().setYaw(mc.player.getYaw());
float yaw = event.getBoat().getYaw();
int dx = 0, dy = 0, dz = 0;
if (mc.options.rightKey.isPressed()) dx++;
if (mc.options.leftKey.isPressed()) dx--;
if (mc.options.jumpKey.isPressed()) dy++;
if (mc.options.sprintKey.isPressed()) dy--;
// ctrl para bajar, en vez de shift, porque si no te desmontas
if (mc.options.backKey.isPressed()) dz++;
if (mc.options.forwardKey.isPressed()) dz--;
double speed = this.speed.getValue();
double sin = Math.sin(Math.toRadians(yaw));
double cos = Math.cos(Math.toRadians(yaw));
double x = speed * dz * sin;
double y = speed * dy;
double z = speed * dz * -cos;
x += speed * dx * -cos;
z += speed * dx * -sin;
event.getBoat().setVelocity(new Vec3d(x, y, z));
}
@Subscribe
private void onReceivePacket(PacketEvent.Receive event) {
if (event.getPacket() instanceof VehicleMoveS2CPacket && cancelPackets.getValue()) {
event.cancel();
}
}
}
@@ -0,0 +1,20 @@
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
public class Dolphin extends Module {
public Dolphin() {
super("delfín", "*ruido de delfín*", Category.MOVEMENT);
}
@Override
public void onTick() {
if (mc.player == null) return;
if (mc.player.isSubmergedInWater()) {
if (!mc.player.isJumping()) mc.player.jump();
}
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.module.modules.player;
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
@@ -13,7 +13,7 @@ import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
public class ElytraBounce extends Module {
public ElytraBounce() {
super("conejo", "haz el elytra-bounce manteniendo el espacio", Category.PLAYER);
super("conejo", "haz el elytra-bounce manteniendo el espacio", Category.MOVEMENT);
}
public boolean bounce() {
@@ -0,0 +1,61 @@
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.math.Vec3d;
public class ElytraFly extends Module {
public NumberSetting speed = sgGeneral.add(new NumberSetting(
"velocidad",
"mi madre es parcialmente vagabunda",
1,
0,
5,
0.1
));
public ElytraFly() {
super("elytras", "vuela con elytras", Category.MOVEMENT);
}
@Override
public void onTick() {
if (mc.player == null || !mc.player.isGliding() || !wearingElytra()) return;
float yaw = mc.player.getYaw();
int dx = 0, dy = 0, dz = 0;
if (mc.options.rightKey.isPressed()) dx++;
if (mc.options.leftKey.isPressed()) dx--;
if (mc.options.jumpKey.isPressed()) dy++;
if (mc.options.sneakKey.isPressed()) dy--;
if (mc.options.backKey.isPressed()) dz++;
if (mc.options.forwardKey.isPressed()) dz--;
double speed = this.speed.getValue();
double sin = Math.sin(Math.toRadians(yaw));
double cos = Math.cos(Math.toRadians(yaw));
double x = speed * dz * sin;
double y = speed * dy;
double z = speed * dz * -cos;
x += speed * dx * -cos;
z += speed * dx * -sin;
mc.player.setVelocity(new Vec3d(x, y, z));
}
private boolean wearingElytra() {
ItemStack equippedStack = mc.player.getEquippedStack(EquipmentSlot.CHEST);
return equippedStack != null && equippedStack.getItem() == Items.ELYTRA;
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.module.modules.player;
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
@@ -11,7 +11,7 @@ public class Headhitters extends Module {
public Headhitters() {
super("headhitters",
"mantén pulsado el espacio para hacer headhitting sin tener que espamearlo",
Category.PLAYER);
Category.MOVEMENT);
}
@Override
@@ -1,4 +1,4 @@
package me.retucio.sputnik.module.modules.player;
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.UseItemEvent;
@@ -66,7 +66,7 @@ public class InfiniteElytra extends Module {
public InfiniteElytra() {
super("avioneta",
"vuela infinitamente, aprovechándose el sistema defectuoso que hizo mojang (hace falta tirarse de unos 50 bloques de altura)",
Category.PLAYER);
Category.MOVEMENT);
}
@@ -0,0 +1,133 @@
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.BlockShapeEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.SettingGroup;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.fluid.FluidState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShapes;
public class Jesus extends Module {
SettingGroup sgBlocks = addSg(new SettingGroup("bloques", true));
public EnumSetting<JesusMode> mode = sgGeneral.add(new EnumSetting<>(
"modo",
"cómo caminar",
JesusMode.class,
JesusMode.SOLID
));
public BooleanSetting allowSneaking = sgGeneral.add(new BooleanSetting(
"permitir agacharse",
"te permite usar el botón de agacharse para sumergirte en el agua",
true
));
public NumberSetting minFallHeight = sgGeneral.add(new NumberSetting(
"distancia de caída",
"distancia de caída mínima para sumergirse en vez de impactar",
3,
0.1,
10,
0.1
));
public BooleanSetting water = sgBlocks.add(new BooleanSetting(
"agua",
"permitir caminar en agua",
true
));
public BooleanSetting lava = sgBlocks.add(new BooleanSetting(
"lava",
"permitir caminar en lava",
true
));
public BooleanSetting powderedSnow = sgBlocks.add(new BooleanSetting(
"nieve en polvo",
"permitir caminar en nieve en polvo",
true
));
public Jesus() {
super("jesús", "te permite caminar sobre el agua", Category.MOVEMENT);
}
@Override
public void onTick() {
if (mc.player == null || mc.world == null) return;
Entity entity = mc.player.getRootVehicle();
if (entity.isSneaking() && allowSneaking.getValue()) {
return;
}
if (entity.fallDistance >= minFallHeight.getValue()) {
return;
}
if (!mode.is(JesusMode.VIBRATE)) return;
if (isSubmerged(entity.getEntityPos().add(new Vec3d(0, 0.3, 0)))) {
entity.setVelocity(entity.getVelocity().x, 0.08, entity.getVelocity().z);
}
else if (isSubmerged(entity.getEntityPos().add(new Vec3d(0, 0.1, 0)))) {
entity.setVelocity(entity.getVelocity().x, 0.05, entity.getVelocity().z);
}
else if (isSubmerged(entity.getEntityPos().add(new Vec3d(0, 0.05, 0)))) {
entity.setVelocity(entity.getVelocity().x, 0.01, entity.getVelocity().z);
}
else if (isSubmerged(entity.getEntityPos())) {
entity.setVelocity(entity.getVelocity().x, -0.005, entity.getVelocity().z);
entity.setOnGround(true);
}
}
@SubscribeEvent
public void onBlockShape(BlockShapeEvent event) {
if (event.getState().getBlock() == Blocks.LAVA && !lava.getValue()) return;
if (event.getState().getBlock() == Blocks.WATER && !water.getValue()) return;
if (event.getState().getBlock() == Blocks.POWDER_SNOW && !powderedSnow.getValue()) return;
if (mode.getValue() == JesusMode.SOLID)
if (event.getState().getBlock() == Blocks.POWDER_SNOW
&& !mc.player.isSneaking()
&& mc.player.getY() > event.getPos().getY() + 1) {
event.setShape(VoxelShapes.cuboid(0, 0, 0, 1, 1.01, 1));
} else if (!mc.world.getFluidState(event.getPos()).isEmpty()
&& !mc.player.isSneaking()
&& !mc.player.isTouchingWater()
&& mc.player.getY() >= event.getPos().getY() + 0.9) {
event.setShape(VoxelShapes.cuboid(0, 0, 0, 1, 0.9, 1));
}
}
private boolean isSubmerged(Vec3d pos) {
BlockPos blockPos = BlockPos.ofFloored(pos);
FluidState state = mc.world.getFluidState(blockPos);
return !state.isEmpty() && pos.y - blockPos.getY() <= state.getHeight();
}
public enum JesusMode {
VIBRATE("vibrador"),
SOLID("sólido");
private final String name;
JesusMode(String name) { this.name = name; }
@Override public String toString() { return name; }
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.module.modules.player;
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
@@ -34,7 +34,7 @@ public class ReverseStep extends Module {
public ReverseStep() {
super("escalones inversos",
"escalones pero pabajo",
Category.PLAYER
Category.MOVEMENT
);
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.module.modules.player;
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.ClipAtLedgeEvent;
@@ -18,7 +18,7 @@ public class SafeWalk extends Module {
public SafeWalk() {
super("muletas",
"te ayuda a no caerte de bloques, sin agacharte",
Category.PLAYER);
Category.MOVEMENT);
}
@SubscribeEvent
@@ -0,0 +1,45 @@
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.mixin.accessor.AbstractBlockAccessor;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.block.Block;
import net.minecraft.util.math.Vec3i;
import java.util.HashMap;
import java.util.Map;
public class Slippy extends Module {
public NumberSetting slipperiness = sgGeneral.add(new NumberSetting(
"cantidad de semen",
"cuánto semen agregar a los bloques por los que pasas",
1,
0,
2,
0.01
));
private final Map<Block, Float> modifiedBlocks = new HashMap<>();
public Slippy() {
super("patinaje", "añade una fina capa de semen a los bloques que pisas", Category.MOVEMENT);
}
@Override
public void onDisable() {
for (Block block : modifiedBlocks.keySet()) {
((AbstractBlockAccessor) block).setSlipperiness(modifiedBlocks.get(block));
}
}
@Override
public void onTick() {
if (mc.player == null || mc.world == null) return;
Block block = mc.world.getBlockState(mc.player.getBlockPos().add(new Vec3i(0, -1, 0))).getBlock();
if (block.getSlipperiness() == slipperiness.getFloatValue()) return;
if (!modifiedBlocks.containsKey(block)) modifiedBlocks.put(block, block.getSlipperiness());
((AbstractBlockAccessor) block).setSlipperiness(slipperiness.getFloatValue());
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.module.modules.player;
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
@@ -12,6 +12,6 @@ public class Step extends Module {
));
public Step() {
super("escalones", "hace que el bloque de subida de escalón sea la distancia deseada", Category.PLAYER);
super("escalones", "hace que el bloque de subida de escalón sea la distancia deseada", Category.MOVEMENT);
}
}
@@ -0,0 +1,28 @@
package me.retucio.sputnik.module.modules.movement;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
public class TridentBoost extends Module {
public NumberSetting multiplier = sgGeneral.add(new NumberSetting(
"boost",
"multiplicador del movimiento",
2,
0,
5,
0.1
));
public BooleanSetting outOfWater = sgGeneral.add(new BooleanSetting(
"fuera del agua",
"permitir el uso de la propulsión acuática fuera del agua",
true
));
public TridentBoost() {
super("tenedor mágico", "hermano se piensa que es Poseidón", Category.MOVEMENT);
}
}
@@ -0,0 +1,169 @@
package me.retucio.sputnik.module.modules.network;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.AttackBlockEvent;
import me.retucio.sputnik.event.events.Render3DEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.SettingGroup;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.ColorSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.render.RenderUtil;
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class PacketMine extends Module {
SettingGroup sgRender = addSg(new SettingGroup("renderizado", true));
public NumberSetting retryTime = sgGeneral.add(new NumberSetting(
"delay",
"delay entre reintentos de minado",
30,
0,
1000,
1
));
public BooleanSetting cancelOutOfReach = sgGeneral.add(new BooleanSetting(
"cancelar fuera de alcance",
"cancelar aquellos paquetes que intenten romper bloques fuera del alcance del jugador, para evitar flaggear el anticheat",
true
));
public BooleanSetting render = sgRender.add(new BooleanSetting(
"renderizar",
"renderizar un contorno alrededor de los bloques que están siendo minados",
true
));
public ColorSetting color = sgRender.add(new ColorSetting(
"color",
"color del contorno renderizado",
new Color(0, 255, 0, 100),
false
));
public NumberSetting lineWidth = sgRender.add(new NumberSetting(
"grosor",
"grosor de las líneas del contorno",
2,
0.1,
10,
0.1
));
public PacketMine() {
super("selección de minado",
"selecciona bloques a minar con paquetes",
Category.NETWORK);
render.onUpdate(v -> {
color.setVisible(v);
lineWidth.setVisible(v);
});
}
private final List<MiningBlock> miningBlocks = new ArrayList<>();
@Override
public void onDisable() {
miningBlocks.clear();
super.onDisable();
}
@Override
public void onTick() {
if (mc.player == null || mc.world == null || mc.interactionManager == null) return;
Iterator<MiningBlock> iterator = miningBlocks.iterator();
while (iterator.hasNext()) {
MiningBlock block = iterator.next();
if (mc.world.getBlockState(block.pos).isAir()) {
iterator.remove();
continue;
}
if (!block.mining) {
block.mine();
} else {
if (mc.player.age - block.startTime >= retryTime.getValue()) {
block.startTime = mc.player.age;
block.mining = false;
}
}
}
}
@SubscribeEvent
public void onAttackBlock(AttackBlockEvent event) {
event.cancel();
if (!isMining(event.getPos())) {
miningBlocks.add(new MiningBlock(event));
}
}
@SubscribeEvent
public void onRenderWorld(Render3DEvent event) {
for (MiningBlock block : miningBlocks) {
block.render(event);
}
}
private boolean isMining(BlockPos pos) {
for (MiningBlock block : miningBlocks) {
if (block.pos.equals(pos)) return true;
}
return false;
}
private class MiningBlock {
BlockPos pos;
Direction dir;
boolean mining;
long startTime;
public MiningBlock(AttackBlockEvent event) {
this.pos = event.getPos();
this.dir = event.getDir();
mining = false;
startTime = mc.player.age;
}
public void mine() {
if (pos.getSquaredDistance(mc.player.getEntityPos()) > Math.pow(mc.player.getBlockInteractionRange(), 2)
&& cancelOutOfReach.getValue()) {
return;
}
mc.interactionManager.sendSequencedPacket(mc.world, sequence ->
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, dir, sequence));
mining = true;
mc.interactionManager.sendSequencedPacket(mc.world, sequence ->
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, pos, dir, sequence));
}
public void render(Render3DEvent event) {
VoxelShape shape = mc.world.getBlockState(pos).getOutlineShape(mc.world, pos);
RenderUtil.drawVoxelShapeOutline(
event.getMatrices(),
shape,
pos,
color.getValue(),
lineWidth.getFloatValue(),
false
);
}
}
}
@@ -0,0 +1,177 @@
package me.retucio.sputnik.module.modules.player;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.PacketEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.block.Blocks;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Items;
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
// https://github.com/etianl/Trouser-Streak/blob/ce27abd30435ca2b43a5e5546f5b070c07c6291a/src/main/java/pwn/noobs/trouserstreak/modules/MaceKill.java
public class MaceKill extends Module {
public BooleanSetting max = sgGeneral.add(new BooleanSetting(
"máxima potencia",
"simular caída desde el hueco con aire más cercano en un rango de 170 bloques",
false
));
public NumberSetting height = sgGeneral.add(new NumberSetting(
"altura",
"altura de la que simular la caída",
22,
1,
170,
1
));
public BooleanSetting preventDeath = sgGeneral.add(new BooleanSetting(
"prevenir muerte",
"prevenir la muerte por daño de caída si el ataque fue bloqueado, cancelando los paquetes de movimiento",
true
));
public MaceKill() {
super("estampaescrotos", "estampa escrotos ajenos", Category.PLAYER);
max.onUpdate(v -> height.setVisible(!v));
}
@SubscribeEvent
@SuppressWarnings("ConstantConditions")
public void onPacketSend(PacketEvent.Send event) {
if (mc.player == null) return;
if (mc.player.getMainHandStack().getItem() == Items.MACE
&& event.getPacket() instanceof PlayerInteractEntityC2SPacket packet
&& packet.type.getType() == PlayerInteractEntityC2SPacket.InteractType.ATTACK) {
try {
if (mc.world.getEntityById(packet.entityId) instanceof LivingEntity target) {
if (preventDeath.getValue()
&& (target.isBlocking()
|| target.isInvulnerable()
|| target.isInCreativeMode()
)) {
return;
}
Vec3d previouspos = mc.player.getEntityPos();
int blocks = getMaxHeightAbovePlayer();
int packetsRequired = (int) (double) Math.abs(blocks / 10);
if (packetsRequired > 20) {
packetsRequired = 1;
}
BlockPos gap1 = (mc.player.getBlockPos().add(0, blocks, 0));
BlockPos gap2 = (mc.player.getBlockPos().add(0, blocks + 1, 0));
if (isSafeBlock(gap1) && isSafeBlock(gap2)) {
if (blocks <= 22) {
if (mc.player.hasVehicle()) {
for (int i = 0; i < 4; i++) {
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
}
double maxHeight = Math.min(mc.player.getVehicle().getY() + 22, mc.player.getVehicle().getY() + blocks);
mc.player.getVehicle().setPosition(mc.player.getVehicle().getX(), maxHeight + blocks, mc.player.getVehicle().getZ());
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
mc.player.getVehicle().setPosition(previouspos);
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
} else {
for (int i = 0; i < 4; i++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(false, mc.player.horizontalCollision));
}
double maxHeight = Math.min(mc.player.getY() + 22, mc.player.getY() + blocks);
PlayerMoveC2SPacket movePacket = new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), maxHeight, mc.player.getZ(), false, mc.player.horizontalCollision);
mc.player.networkHandler.sendPacket(movePacket);
PlayerMoveC2SPacket returnPacket = new PlayerMoveC2SPacket.PositionAndOnGround(previouspos.getX(), previouspos.getY(), previouspos.getZ(), false, mc.player.horizontalCollision);
mc.player.networkHandler.sendPacket(returnPacket);
}
} else {
if (mc.player.hasVehicle()) {
for (int packetNumber = 0; packetNumber < (packetsRequired - 1); packetNumber++) {
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
}
mc.player.getVehicle().setPosition(mc.player.getVehicle().getX(), mc.player.getVehicle().getY() + blocks, mc.player.getVehicle().getZ());
double maxHeight = mc.player.getVehicle().getY() + blocks;
mc.player.getVehicle().setPosition(mc.player.getVehicle().getX(), maxHeight + blocks, mc.player.getVehicle().getZ());
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
mc.player.getVehicle().setPosition(previouspos);
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
} else {
for (int packetNumber = 0; packetNumber < (packetsRequired - 1); packetNumber++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(false, mc.player.horizontalCollision));
}
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + blocks, mc.player.getZ(), false, mc.player.horizontalCollision));
PlayerMoveC2SPacket movePacket = new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + blocks, mc.player.getZ(), false, mc.player.horizontalCollision);
mc.player.networkHandler.sendPacket(movePacket);
}
if (mc.player.hasVehicle()) {
mc.player.getVehicle().setPosition(previouspos);
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
mc.player.getVehicle().setPosition(previouspos);
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
} else {
double maxHeight = mc.player.getY() + blocks;
PlayerMoveC2SPacket movePacket = new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), maxHeight, mc.player.getZ(), false, mc.player.horizontalCollision);
PlayerMoveC2SPacket returnPacket = new PlayerMoveC2SPacket.PositionAndOnGround(previouspos.getX(), previouspos.getY(), previouspos.getZ(), false, mc.player.horizontalCollision);
mc.player.networkHandler.sendPacket(returnPacket);
mc.player.networkHandler.sendPacket(movePacket);
mc.player.networkHandler.sendPacket(returnPacket);
}
}
}
}
} catch (Exception e) {
ChatUtil.error("upsi: " + e.getMessage());
}
}
}
private int getMaxHeightAbovePlayer() {
BlockPos playerPos = mc.player.getBlockPos();
int maxHeight = playerPos.getY() + (max.getValue() ? 170 : height.getIntValue());
for (int i = maxHeight; i > playerPos.getY(); i--) {
BlockPos isopenair1 = new BlockPos(playerPos.getX(), i, playerPos.getZ());
BlockPos isopenair2 = isopenair1.up(1);
if (isSafeBlock(isopenair1) && isSafeBlock(isopenair2)) {
return i - playerPos.getY();
}
}
return 0;
}
private boolean isSafeBlock(BlockPos pos) {
return mc.world.getBlockState(pos).isReplaceable()
&& mc.world.getFluidState(pos).isEmpty()
&& !mc.world.getBlockState(pos).isOf(Blocks.POWDER_SNOW);
}
}
@@ -0,0 +1,95 @@
package me.retucio.sputnik.module.modules.world;
import com.google.gson.Gson;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.SettingGroup;
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.KeySetting;
import me.retucio.sputnik.util.ChatUtil;
import me.retucio.sputnik.util.KeyUtil;
import net.minecraft.block.BlockState;
import net.minecraft.state.property.Property;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d;
import org.lwjgl.glfw.GLFW;
import java.util.Collection;
// copy summon / setblock command
// copy json data to clipboard
// print data (keybinds)
public class BlockInfo extends Module {
public KeySetting key = sgGeneral.add(new KeySetting(
"tecla",
"tecla a pulsar para obtener la info.",
GLFW.GLFW_KEY_CAPS_LOCK
));
public EnumSetting<CopyMode> copy = sgGeneral.add(new EnumSetting<>(
"copiar",
"copiar al portapapeles",
CopyMode.class,
CopyMode.COMMAND
));
public BlockInfo() {
super("info. de bloque",
"muestra el contenido nbt del bloque al que se está apuntando",
Category.WORLD);
}
@SubscribeEvent
public void onKey(KeyEvent event) {
if (mc.player == null || mc.world == null) return;
if (event.getKey() != key.getValue() || event.getAction() != GLFW.GLFW_PRESS) return;
HitResult result = mc.player.getCrosshairTarget(
mc.getRenderTickCounter().getTickProgress(false),
mc.getCameraEntity()
);
if (result == null) {
ChatUtil.warn("no estás apuntando a ningún bloque");
return;
}
if (result instanceof BlockHitResult blockHitResult) {
BlockState state = mc.world.getBlockState(blockHitResult.getBlockPos());
Collection<Property<?>> data = state.getProperties();
for (Property<?> property : data) {
ChatUtil.info(property.getName() + ": " + state.get(property));
}
copy(blockHitResult, data);
} else {
ChatUtil.warn("no estás apuntando a ningún bloque");
}
}
private void copy(BlockHitResult result, Collection<Property<?>> data) {
String json = new Gson().toJson(data);
String name = mc.world.getBlockState(result.getBlockPos()).getBlock().getTranslationKey();
Vec3d pos = result.getPos();
switch (copy.getValue()) {
case JSON -> mc.keyboard.setClipboard(json);
case COMMAND -> mc.keyboard.setClipboard(
String.format("/setblock %f %f %f %s %s", pos.x, pos.y, pos.z, name, json));
}
}
public enum CopyMode {
DONT("no copiar"),
COMMAND("copiar comando /setblock"),
JSON("copiar contenido json");
private final String name;
CopyMode(String name) { this.name = name; }
@Override public String toString() { return name; }
}
}
@@ -10,7 +10,6 @@ import java.util.Map;
public class ColorSetting extends Setting<Color> {
private Color defaultColor;
private final boolean defaultRainbow;
private final int defaultRainbowSpeed;
@@ -21,13 +20,13 @@ public class ColorSetting extends Setting<Color> {
private float saturation;
private float brightness;
public ColorSetting(String name, String description, Color defaultColor, boolean rainbow) {
super(name, description, defaultColor);
public ColorSetting(String name, String description, Color defaultValue, boolean rainbow) {
super(name, description, defaultValue);
this.r = defaultColor.getRed();
this.g = defaultColor.getGreen();
this.b = defaultColor.getBlue();
this.a = defaultColor.getAlpha();
this.r = defaultValue.getRed();
this.g = defaultValue.getGreen();
this.b = defaultValue.getBlue();
this.a = defaultValue.getAlpha();
this.rainbow = rainbow;
this.defaultRainbow = rainbow;
@@ -192,28 +191,20 @@ public class ColorSetting extends Setting<Color> {
}
}
public Color getDefaultColor() {
return defaultColor;
}
public void setDefaultColor(Color defaultColor) {
this.defaultColor = defaultColor;
}
public int getDefaultR() {
return defaultColor.getRed();
return defaultValue.getRed();
}
public int getDefaultG() {
return defaultColor.getGreen();
return defaultValue.getGreen();
}
public int getDefaultB() {
return defaultColor.getBlue();
return defaultValue.getBlue();
}
public int getDefaultA() {
return defaultColor.getAlpha();
return defaultValue.getAlpha();
}
public float getDefaultSaturation() {
@@ -242,10 +233,10 @@ public class ColorSetting extends Setting<Color> {
}
public void reset() {
this.r = defaultColor.getRed();
this.g = defaultColor.getGreen();
this.b = defaultColor.getBlue();
this.a = defaultColor.getAlpha();
this.r = defaultValue.getRed();
this.g = defaultValue.getGreen();
this.b = defaultValue.getBlue();
this.a = defaultValue.getAlpha();
this.rainbow = false;
this.rainbowSpeed = 2;
this.saturation = 1f;
@@ -1,13 +1,17 @@
package me.retucio.sputnik.ui.hud;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.config.ConfigManager;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.client.HUD;
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
import me.retucio.sputnik.util.Colors;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Click;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.input.KeyInput;
import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
@@ -19,15 +23,17 @@ public class HudEditorScreen extends Screen {
public static HudEditorScreen INSTANCE;
private final MinecraftClient mc = MinecraftClient.getInstance();
private final HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
private final List<HudElement> elements = new ArrayList<>();
@Nullable private HudElement selected = null;
private boolean dragging = false;
private int dragOffsetX, dragOffsetY;
private int dragX, dragY;
public HudEditorScreen() {
super(Text.literal("editor del HUD"));
Sputnik.EVENT_BUS.subscribe(this);
}
public void setElements(List<HudElement> elements) {
@@ -40,15 +46,30 @@ public class HudEditorScreen extends Screen {
ctx.fill(0, 0, this.width, this.height, Colors.hudEditorScreenBackgroundColor.getRGB());
// instrucciones
ctx.drawCenteredTextWithShadow(mc.textRenderer, "editor del HUD",
ctx.drawCenteredTextWithShadow(mc.textRenderer, title,
this.width / 2, this.height / 2 - mc.textRenderer.fontHeight, -1);
ctx.drawCenteredTextWithShadow(mc.textRenderer,
Text.literal("arrastrar para mover · clic derecho para visibilidad · ESC para guardar y salir · shift + clic derecho para restablecer"),
this.width / 2, this.height / 2 + mc.textRenderer.fontHeight, Colors.instructionsTextColor.getRGB());
// movimiento axial
if (hud.axialMovement.getValue()) {
int centerX = mc.getWindow().getScaledWidth() / 2;
if (dragging && selected != null && Math.abs(centerX - mouseX) < hud.axisOffset.getValue()) {
dragX = mouseX - centerX + selected.getW() / 2;
ctx.drawVerticalLine(centerX, 0, mc.getWindow().getScaledHeight(), Colors.CELESTE.getRGB());
}
int centerY = mc.getWindow().getScaledHeight() / 2;
if (dragging && selected != null && Math.abs(centerY - mouseY) < hud.axisOffset.getValue()) {
dragY = mouseY - centerY + selected.getH() / 2;
ctx.drawHorizontalLine(0, mc.getWindow().getScaledWidth(), centerY, Colors.CELESTE.getRGB());
}
}
// elementos
for (HudElement element : elements)
element.renderInEditor(ctx, null);
element.renderInEditor(ctx, hud);
// tooltips
if (!dragging) {
@@ -72,17 +93,16 @@ public class HudEditorScreen extends Screen {
int mouseX = (int) click.x();
int mouseY = (int) click.y();
for (int i = elements.size() - 1; i >= 0; i--) {
HudElement element = elements.get(i);
for (HudElement element : elements) {
if (element.isHovered(mouseX, mouseY)) {
selected = element;
if (click.button() == 0) {
dragging = true;
dragOffsetX = mouseX - element.getX();
dragOffsetY = mouseY - element.getY();
dragX = mouseX - element.getX();
dragY = mouseY - element.getY();
elements.remove(i);
elements.remove(element);
elements.add(element);
return true;
@@ -109,8 +129,8 @@ public class HudEditorScreen extends Screen {
int mouseX = (int) click.x();
int mouseY = (int) click.y();
int newX = mouseX - dragOffsetX;
int newY = mouseY - dragOffsetY;
int newX = mouseX - dragX;
int newY = mouseY - dragY;
newX = Math.max(1, Math.min(newX, width - selected.getW() - 1));
newY = Math.max(1, Math.min(newY, height - selected.getH() - 1));
@@ -132,15 +152,36 @@ public class HudEditorScreen extends Screen {
return super.mouseReleased(click);
}
@Override
public boolean keyPressed(KeyInput input) {
if (input.key() == GLFW.GLFW_KEY_ESCAPE) {
@SubscribeEvent
// he sustituído el método del súper por un evento para ver si así se podían
// registrar dos teclas a la vez, pero resulta que no :P
public void onKey(KeyEvent event) {
if (!(mc.currentScreen == INSTANCE)) return;
if (event.getAction() == GLFW.GLFW_RELEASE) return;
event.cancel();
// guardar y salir
if (event.getKey() == GLFW.GLFW_KEY_ESCAPE) {
saveAllElementsToConfig();
selected = null;
mc.setScreen(null);
return true;
}
return super.keyPressed(input);
// movimiento de los elementos con las teclas de las flechas
else if (hud.arrowMovement.getValue() && selected != null) {
int offset = hud.arrowOffset.getIntValue();
if (event.getKey() == GLFW.GLFW_KEY_UP) {
selected.setY(Math.max(1, selected.getY() - offset));
}
if (event.getKey() == GLFW.GLFW_KEY_DOWN) {
selected.setY(Math.min(mc.getWindow().getScaledHeight() - selected.getH() + 1, selected.getY() + offset));
}
if (event.getKey() == GLFW.GLFW_KEY_LEFT) {
selected.setX(Math.max(1, selected.getX() - offset));
}
if (event.getKey() == GLFW.GLFW_KEY_RIGHT) {
selected.setX(Math.min(mc.getWindow().getScaledWidth() - selected.getW() + 1, selected.getX() + offset));
}
}
}
private void saveElementToConfig(HudElement element) {
@@ -25,11 +25,6 @@ public abstract class HudElement extends Widget {
public abstract void renderInEditor(DrawContext ctx, HUD hud);
public abstract List<Text> getTooltip();
public boolean isHovered(int mouseX, int mouseY) {
return mouseX >= x && mouseX <= x + w
&& mouseY >= y && mouseY <= y + w;
}
public String getId() { return id; }
public boolean isVisible() { return visible; }
@@ -93,31 +93,26 @@ public class HudRenderer {
}
public static void render(DrawContext ctx, RenderTickCounter tickCounter) {
if (shouldSkipRendering()) return;
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
if (!hud.isEnabled()) return;
if (mc.debugHudEntryList.isF3Enabled() && !hud.showOnF3.getValue()) return;
if (mc.currentScreen instanceof ChatScreen && !hud.showOnChat.getValue()) return;
init();
if (mc.currentScreen instanceof HudEditorScreen) return;
float delta = tickCounter.getDynamicDeltaTicks();
for (HudElement element : elements) {
if (element.isVisible()) {
element.renderInGame(ctx, delta, hud);
if (element.isVisible() && !shouldSkipRendering()) {
element.renderInGame(ctx, tickCounter.getDynamicDeltaTicks(), hud);
}
}
}
private static boolean shouldSkipRendering() {
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
return ModuleManager.INSTANCE == null
|| mc.player == null
|| mc.getCameraEntity() == null
|| mc.currentScreen instanceof TitleScreen
|| mc.options.hudHidden;
|| mc.options.hudHidden
|| !hud.isEnabled()
|| (mc.debugHudEntryList.isF3Enabled() && !hud.showOnF3.getValue())
|| (mc.currentScreen instanceof ChatScreen && !hud.showOnChat.getValue())
|| mc.currentScreen instanceof HudEditorScreen;
}
public static List<HudElement> getElements() {
@@ -20,6 +20,8 @@ public class CoordsElement extends TextHudElement {
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
Vec3d pos = freecam != null && freecam.isEnabled()
? new Vec3d(freecam.getX(delta), freecam.getY(delta), freecam.getZ(delta))
: mc.player == null
? new Vec3d(67, 67, 67)
: mc.player.getEntityPos();
String overworldCoords = (int) pos.x + " " + (int) pos.y + " " + (int) pos.z;
@@ -20,7 +20,7 @@ public class FpsElement extends TextHudElement {
@Override
public String getPreviewText() {
return "FPS: 67";
return "FPS: " + mc.getCurrentFps();
}
@Override
@@ -20,7 +20,7 @@ public class TimeElement extends TextHudElement {
@Override
public String getPreviewText() {
return "04:20 PM";
return MiscUtil.getCurrentFormattedTime();
}
@Override
@@ -33,10 +33,35 @@ public class TotemsElement extends ImageHudElement {
if (stack.getItem() == Items.TOTEM_OF_UNDYING)
count++;
}
} else {
count = 69;
}
ItemStack stack = new ItemStack(Items.TOTEM_OF_UNDYING, Math.max(1, count));
drawItem(ctx, new ItemStack(Items.TOTEM_OF_UNDYING, Math.max(1, count)), count);
}
@Override
public void renderInEditor(DrawContext ctx, HUD hud) {
int count = 0;
if (mc.player != null) {
for (ItemStack stack : mc.player.getInventory()) {
if (stack.getItem() == Items.TOTEM_OF_UNDYING)
count++;
}
} else {
count = 69;
}
drawEditorBackground(ctx);
drawItem(ctx, new ItemStack(Items.TOTEM_OF_UNDYING, Math.max(1, count)), count);
}
@Override
public List<Text> getTooltip() {
return List.of(Text.of("totems disponibles"));
}
private void drawItem(DrawContext ctx, ItemStack stack, int count) {
ctx.drawItem(stack, x, y);
if (count > 1) {
ctx.drawStackOverlay(mc.textRenderer, stack, x, y);
@@ -54,24 +79,4 @@ public class TotemsElement extends ImageHudElement {
);
}
}
@Override
public void renderInEditor(DrawContext ctx, HUD hud) {
int count = 0;
if (mc.player != null) {
for (ItemStack stack : mc.player.getInventory()) {
if (stack.getItem() == Items.TOTEM_OF_UNDYING)
count++;
}
}
drawEditorBackground(ctx);
ctx.drawItem(new ItemStack(Items.TOTEM_OF_UNDYING, count), x, y);
}
@Override
public List<Text> getTooltip() {
return List.of(Text.of("totems disponibles"));
}
}
@@ -31,6 +31,7 @@ import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import java.util.ArrayList;
@@ -47,7 +48,7 @@ public class ClickGUI extends Screen {
public static ClickGUI INSTANCE;
private boolean anyFocused;
private Widget selected = null;
private @Nullable Widget selected = null;
private Category categoryFilter = Category.ALL;
@@ -36,7 +36,7 @@ public class ColorButton extends SettingButton<ColorSetting> {
int previewX = x + 5;
int previewY = y + 3;
DrawUtil.drawBorder(ctx, previewX - 1, previewY - 1, previewSize + 2, previewSize + 2, setting.isRainbow() ? Colors.mainColor.getRGB() : -1);
DrawUtil.drawBorder(ctx, previewX - 1, previewY - 1, previewSize + 2, previewSize + 2, Colors.getOppositeColor(setting.getValue(), true).getRGB());
ctx.fill(previewX, previewY, previewX + previewSize, previewY + previewSize, setting.getValue().getRGB());
// texto
@@ -6,6 +6,7 @@ import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.KeyUtil;
import me.retucio.sputnik.util.MiscUtil;
import net.minecraft.client.gui.DrawContext;
import org.lwjgl.glfw.GLFW;
@@ -58,7 +59,7 @@ public class TextButton extends SettingButton<StringSetting> {
// pegar con ctrl + v
if (key == GLFW.GLFW_KEY_V && KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
buffer.append(mc.keyboard.getClipboard());
paste();
return;
}
@@ -94,8 +95,11 @@ public class TextButton extends SettingButton<StringSetting> {
return typing;
}
private void onBackspace() {
if (!buffer.isEmpty())
buffer.deleteCharAt(buffer.length() - 1);
public void onBackspace() {
MiscUtil.backspace(buffer);
}
public void paste() {
buffer.append(MiscUtil.getPasteContent(setting.getMaxLength() - buffer.length()));
}
}
@@ -278,7 +278,7 @@ public class ColorPickerFrame extends SettingsFrame {
// gradiente vertical
for (int sy = 0; sy < saturationBrightnessPickerHeight; sy++) {
float brightness = 1 - (sy / (float) saturationBrightnessPickerHeight);
float brightness = (sy / (float) saturationBrightnessPickerHeight);
int alpha = (int)(brightness * 255);
Color overlay = new Color(0, 0, 0, alpha);
ctx.fill(saturationBrightnessPickerX, saturationBrightnessPickerY + sy,
@@ -11,6 +11,7 @@ import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
import me.retucio.sputnik.ui.widgets.Widget;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.KeyUtil;
import me.retucio.sputnik.util.MiscUtil;
import me.retucio.sputnik.util.render.Textures;
import net.minecraft.client.gl.RenderPipelines;
import net.minecraft.client.gui.DrawContext;
@@ -130,6 +131,11 @@ public class SearchBarWidget extends Widget {
if (!ClientSettingsFrame.guiSettings.searchBar.getValue()) return;
if (!focused || action == GLFW.GLFW_RELEASE) return;
if (key == GLFW.GLFW_KEY_V && KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
paste();
return;
}
switch (key) {
case GLFW.GLFW_KEY_ENTER -> focused = false;
case GLFW.GLFW_KEY_ESCAPE -> {
@@ -151,7 +157,11 @@ public class SearchBarWidget extends Widget {
}
public void onBackspace() {
if (!buffer.isEmpty()) buffer.deleteCharAt(buffer.length() - 1);
MiscUtil.backspace(buffer);
}
public void paste() {
buffer.append(MiscUtil.getPasteContent(-1));
}
public void charTyped(char c) {
@@ -147,4 +147,16 @@ public class Colors {
int bDiff = c1.getBlue() - c2.getBlue();
return rDiff * rDiff + gDiff * gDiff + bDiff * bDiff;
}
// espacio de colores RGB, no RYB
public static Color getOppositeColor(Color c, boolean keepAlpha) {
int alpha = c.getAlpha();
if (!keepAlpha) alpha = 255 - alpha;
return new Color(
255 - c.getRed(),
255 - c.getGreen(),
255 - c.getBlue(),
alpha
);
}
}
@@ -7,6 +7,7 @@ import me.retucio.sputnik.module.modules.client.HUD;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.util.math.Vec3d;
import org.joml.Vector3d;
import org.lwjgl.glfw.GLFW;
import java.time.Instant;
import java.time.LocalTime;
@@ -66,4 +67,22 @@ public class MiscUtil {
.replace("ú", "u");
}
public static String getPasteContent(int maxLength) {
if (maxLength == -1) return mc.keyboard.getClipboard();
return mc.keyboard.getClipboard().substring(0, Math.min(maxLength, mc.keyboard.getClipboard().length()));
}
public static void backspace(StringBuilder buffer) {
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_LEFT_CONTROL)) {
for (int i = buffer.length() - 1; i >= 0; i--) {
char c = buffer.charAt(i);
buffer.deleteCharAt(i);
if (c == ' ') break;
}
} else {
if (!buffer.isEmpty()) {
buffer.deleteCharAt(buffer.length() - 1);
}
}
}
}
+27 -18
View File
@@ -1,38 +1,47 @@
accessWidener v2 named
accessible class net/minecraft/client/MinecraftClient$LoadingContext
accessible field net/minecraft/client/texture/TextureManager textures Ljava/util/Map;
# red
accessible field net/minecraft/client/network/DataQueryHandler expectedTransactionId I
accessible field net/minecraft/network/ClientConnection queuedTasks Ljava/util/Queue;
accessible method net/minecraft/network/ClientConnection handleQueuedTasks ()V
accessible method net/minecraft/network/ClientConnection sendImmediately (Lnet/minecraft/network/packet/Packet;Lio/netty/channel/ChannelFutureListener;Z)V
accessible field net/minecraft/network/ClientConnection queuedTasks Ljava/util/Queue;
accessible method net/minecraft/network/ClientConnection handlePacket (Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;)V
accessible method net/minecraft/client/world/ClientWorld getPendingUpdateManager ()Lnet/minecraft/client/network/PendingUpdateManager;
accessible method net/minecraft/client/network/ClientPlayerInteractionManager sendSequencedPacket (Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/network/SequencedPacketCreator;)V
accessible class net/minecraft/client/network/ClientCommonNetworkHandler$ConfirmServerResourcePackScreen
accessible class net/minecraft/client/network/ClientCommonNetworkHandler$ConfirmServerResourcePackScreen$Pack
accessible class net/minecraft/client/font/TextRenderer$Drawer
# texto
accessible method net/minecraft/client/font/FontManager getStorageInternal (Lnet/minecraft/util/Identifier;)Lnet/minecraft/client/font/FontStorage;
accessible class net/minecraft/client/font/TextRenderer$Drawer
# entidad
accessible field net/minecraft/entity/LivingEntity jumpingCooldown I
accessible method net/minecraft/entity/Entity setFlag (IZ)V
accessible method net/minecraft/entity/player/PlayerEntity canGlide ()Z
accessible class net/minecraft/client/particle/ParticleSpriteManager$SpriteAwareFactory
accessible class net/minecraft/client/particle/ParticleSpriteManager$SimpleSpriteProvider
accessible field net/minecraft/client/particle/BillboardParticle alpha F
accessible field net/minecraft/client/particle/BillboardParticle scale F
accessible field net/minecraft/client/particle/Particle velocityMultiplier F
accessible field net/minecraft/client/particle/Particle gravityStrength F
accessible field net/minecraft/client/particle/Particle collidesWithWorld Z
accessible field net/minecraft/entity/LivingEntity jumpingCooldown I
accessible method net/minecraft/entity/LivingEntity calcGlidingVelocity (Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
accessible method net/minecraft/client/render/RenderLayer <init> (Ljava/lang/String;Lnet/minecraft/client/render/RenderSetup;)V
# partícula
accessible field net/minecraft/client/particle/BillboardParticle alpha F
accessible field net/minecraft/client/particle/Particle velocityMultiplier F
accessible field net/minecraft/client/particle/BillboardParticle scale F
accessible field net/minecraft/client/particle/Particle gravityStrength F
accessible field net/minecraft/client/particle/Particle collidesWithWorld Z
accessible class net/minecraft/client/particle/ParticleSpriteManager$SpriteAwareFactory
accessible class net/minecraft/client/particle/ParticleSpriteManager$SimpleSpriteProvider
# renderizado 3d
accessible field net/minecraft/client/render/WorldRenderer worldRenderState Lnet/minecraft/client/render/state/WorldRenderState;
accessible method net/minecraft/client/render/RenderLayer <init> (Ljava/lang/String;Lnet/minecraft/client/render/RenderSetup;)V
accessible method net/minecraft/client/render/GameRenderer getProjectionMatrix (F)Lorg/joml/Matrix4f;
# misc.
accessible field net/minecraft/client/texture/TextureManager textures Ljava/util/Map;
accessible method net/minecraft/screen/ScreenHandlerType register (Ljava/lang/String;Lnet/minecraft/screen/ScreenHandlerType$Factory;)Lnet/minecraft/screen/ScreenHandlerType;
accessible method net/minecraft/client/Keyboard onKey (JILnet/minecraft/client/input/KeyInput;)V
accessible class net/minecraft/client/MinecraftClient$LoadingContext
accessible field net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket type Lnet/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractTypeHandler;
accessible field net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket entityId I
accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractType
accessible method net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractTypeHandler getType ()Lnet/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractType;
+4
View File
@@ -3,6 +3,8 @@
"package": "me.retucio.sputnik.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"BlockCollisionSpliteratorMixin",
"AbstractBoatEntityMixin",
"ClientConnectionMixin",
"EntityMixin",
"HandshakeC2SPacketMixin",
@@ -14,8 +16,10 @@
"PlayerEntityMixin",
"ServerConnectorMixin",
"StringHelperMixin",
"TridentItemMixin",
"Vec3dMixin",
"YggdrasilUserApiServiceMixin",
"accessor.AbstractBlockAccessor",
"accessor.ConfirmServerResourcePackScreenAccessor",
"accessor.PackAccessor",
"accessor.StatusEffectInstanceAccessor"