From 86594f1ca37e425419e0c6271f182c45a215b040 Mon Sep 17 00:00:00 2001 From: retuci0 Date: Sun, 18 Jan 2026 22:50:58 +0100 Subject: [PATCH] v2.9 --- build.gradle | 4 +- cambios.md | 29 +-- gradle.properties | 2 +- src/main/java/me/retucio/sputnik/Sputnik.java | 1 + .../retucio/sputnik/event/BoatMoveEvent.java | 27 +++ .../event/events/AttackBlockEvent.java | 24 +++ .../sputnik/event/events/BlockShapeEvent.java | 43 +++++ .../mixin/AbstractBoatEntityMixin.java | 31 +++ .../mixin/BlockCollisionSpliteratorMixin.java | 33 ++++ .../ClientPlayerInteractionManagerMixin.java | 23 ++- .../me/retucio/sputnik/mixin/EntityMixin.java | 15 +- .../sputnik/mixin/GameRendererMixin.java | 10 + .../sputnik/mixin/LivingEntityMixin.java | 4 +- .../sputnik/mixin/TridentItemMixin.java | 39 ++++ .../mixin/accessor/AbstractBlockAccessor.java | 13 ++ .../me/retucio/sputnik/module/Category.java | 1 + .../retucio/sputnik/module/ModuleManager.java | 160 ++++++++++------ .../sputnik/module/modules/client/GUI.java | 76 ++++++-- .../module/modules/misc/UnfocusedCpu.java | 11 ++ .../module/modules/movement/BoatFly.java | 91 +++++++++ .../module/modules/movement/Dolphin.java | 20 ++ .../{player => movement}/ElytraBounce.java | 4 +- .../module/modules/movement/ElytraFly.java | 61 ++++++ .../{player => movement}/Headhitters.java | 4 +- .../{player => movement}/InfiniteElytra.java | 4 +- .../module/modules/movement/Jesus.java | 133 +++++++++++++ .../{player => movement}/ReverseStep.java | 4 +- .../{player => movement}/SafeWalk.java | 4 +- .../module/modules/movement/Slippy.java | 45 +++++ .../modules/{player => movement}/Step.java | 4 +- .../module/modules/movement/TridentBoost.java | 28 +++ .../module/modules/network/PacketMine.java | 169 +++++++++++++++++ .../module/modules/player/MaceKill.java | 177 ++++++++++++++++++ .../module/modules/world/BlockInfo.java | 95 ++++++++++ src/main/resources/sputnik.accesswidener | 45 +++-- src/main/resources/sputnik.mixins.json | 4 + 36 files changed, 1317 insertions(+), 121 deletions(-) create mode 100644 src/main/java/me/retucio/sputnik/event/BoatMoveEvent.java create mode 100644 src/main/java/me/retucio/sputnik/event/events/AttackBlockEvent.java create mode 100644 src/main/java/me/retucio/sputnik/event/events/BlockShapeEvent.java create mode 100644 src/main/java/me/retucio/sputnik/mixin/AbstractBoatEntityMixin.java create mode 100644 src/main/java/me/retucio/sputnik/mixin/BlockCollisionSpliteratorMixin.java create mode 100644 src/main/java/me/retucio/sputnik/mixin/TridentItemMixin.java create mode 100644 src/main/java/me/retucio/sputnik/mixin/accessor/AbstractBlockAccessor.java create mode 100644 src/main/java/me/retucio/sputnik/module/modules/misc/UnfocusedCpu.java create mode 100644 src/main/java/me/retucio/sputnik/module/modules/movement/BoatFly.java create mode 100644 src/main/java/me/retucio/sputnik/module/modules/movement/Dolphin.java rename src/main/java/me/retucio/sputnik/module/modules/{player => movement}/ElytraBounce.java (96%) create mode 100644 src/main/java/me/retucio/sputnik/module/modules/movement/ElytraFly.java rename src/main/java/me/retucio/sputnik/module/modules/{player => movement}/Headhitters.java (87%) rename src/main/java/me/retucio/sputnik/module/modules/{player => movement}/InfiniteElytra.java (97%) create mode 100644 src/main/java/me/retucio/sputnik/module/modules/movement/Jesus.java rename src/main/java/me/retucio/sputnik/module/modules/{player => movement}/ReverseStep.java (96%) rename src/main/java/me/retucio/sputnik/module/modules/{player => movement}/SafeWalk.java (95%) create mode 100644 src/main/java/me/retucio/sputnik/module/modules/movement/Slippy.java rename src/main/java/me/retucio/sputnik/module/modules/{player => movement}/Step.java (80%) create mode 100644 src/main/java/me/retucio/sputnik/module/modules/movement/TridentBoost.java create mode 100644 src/main/java/me/retucio/sputnik/module/modules/network/PacketMine.java create mode 100644 src/main/java/me/retucio/sputnik/module/modules/player/MaceKill.java create mode 100644 src/main/java/me/retucio/sputnik/module/modules/world/BlockInfo.java diff --git a/build.gradle b/build.gradle index b4e41b9..fe54386 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'fabric-loom' version "${loom_version}" - id 'maven-publish' + id 'fabric-loom' version "${loom_version}" + id 'maven-publish' } version = project.mod_version diff --git a/cambios.md b/cambios.md index 203d369..0461259 100644 --- a/cambios.md +++ b/cambios.md @@ -1,24 +1,29 @@ -# v2.8 +# 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 +- categoría de movimiento + #### módulos nuevos: +- 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 -- arreglado el gradiente del selector de colores -- ahora el marco del preview del color en el botón del ajuste de color será el color complementario (rgb, no ryb) del color seleccionado - -- ahora puedes borrar palabras enteras con ctrl + borrar - -- mejoras al HUD: - - movimiento axial: centra los elementos más fácilmente - - movimiento con flechas: mueve el elemento seleccionado con las flechas - - ahora se puede abrir y usar el editor aun sin estar en un mundo - - más previews de elementos coinciden con su valor actual - - al parecer he arreglado sin querer un problema que había que no te dejaba seleccionar correctamente elementos del hud +- ahora puedes cambiar el título de la ventana en los ajustes del mod ## problemas reconocidos diff --git a/gradle.properties b/gradle.properties index c2b9690..bc0fac2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT fabric_api_version=0.140.2+1.21.11 -mod_version=2.8 +mod_version=2.9 maven_group=me.retucio archives_base_name=sputnik \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/Sputnik.java b/src/main/java/me/retucio/sputnik/Sputnik.java index 0aff097..e10514d 100644 --- a/src/main/java/me/retucio/sputnik/Sputnik.java +++ b/src/main/java/me/retucio/sputnik/Sputnik.java @@ -126,6 +126,7 @@ public class Sputnik implements ClientModInitializer { } ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick); + mc.getWindow().setTitle(ClientSettingsFrame.guiSettings.windowTitle.getValue()); } diff --git a/src/main/java/me/retucio/sputnik/event/BoatMoveEvent.java b/src/main/java/me/retucio/sputnik/event/BoatMoveEvent.java new file mode 100644 index 0000000..0eea3fa --- /dev/null +++ b/src/main/java/me/retucio/sputnik/event/BoatMoveEvent.java @@ -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; + } +} diff --git a/src/main/java/me/retucio/sputnik/event/events/AttackBlockEvent.java b/src/main/java/me/retucio/sputnik/event/events/AttackBlockEvent.java new file mode 100644 index 0000000..1f0083b --- /dev/null +++ b/src/main/java/me/retucio/sputnik/event/events/AttackBlockEvent.java @@ -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; + } +} diff --git a/src/main/java/me/retucio/sputnik/event/events/BlockShapeEvent.java b/src/main/java/me/retucio/sputnik/event/events/BlockShapeEvent.java new file mode 100644 index 0000000..ec24c2f --- /dev/null +++ b/src/main/java/me/retucio/sputnik/event/events/BlockShapeEvent.java @@ -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; + } +} \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/AbstractBoatEntityMixin.java b/src/main/java/me/retucio/sputnik/mixin/AbstractBoatEntityMixin.java new file mode 100644 index 0000000..dc419be --- /dev/null +++ b/src/main/java/me/retucio/sputnik/mixin/AbstractBoatEntityMixin.java @@ -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(); + } + } +} diff --git a/src/main/java/me/retucio/sputnik/mixin/BlockCollisionSpliteratorMixin.java b/src/main/java/me/retucio/sputnik/mixin/BlockCollisionSpliteratorMixin.java new file mode 100644 index 0000000..5a6d0a5 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/mixin/BlockCollisionSpliteratorMixin.java @@ -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 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(); + } +} diff --git a/src/main/java/me/retucio/sputnik/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/me/retucio/sputnik/mixin/ClientPlayerInteractionManagerMixin.java index f046935..5a45d3f 100644 --- a/src/main/java/me/retucio/sputnik/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/ClientPlayerInteractionManagerMixin.java @@ -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 = "", 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 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 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 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 cir) { - FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class); if (!fastUse.isEnabled() || !fastUse.mining.getValue()) return; blockBreakingCooldown = fastUse.miningCooldown.getIntValue(); } diff --git a/src/main/java/me/retucio/sputnik/mixin/EntityMixin.java b/src/main/java/me/retucio/sputnik/mixin/EntityMixin.java index 0fee762..608718a 100644 --- a/src/main/java/me/retucio/sputnik/mixin/EntityMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/EntityMixin.java @@ -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 cir) { + private void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable 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 cir) { + BoatFly boatFly = ModuleManager.INSTANCE.getModuleByClass(BoatFly.class); + if (((Object) this) instanceof AbstractBoatEntity && boatFly.isEnabled()) { + cir.setReturnValue(boatFly.stepHeight.getFloatValue()); + } + } } \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java b/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java index a5c1ed7..d7e443d 100644 --- a/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/GameRendererMixin.java @@ -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) { diff --git a/src/main/java/me/retucio/sputnik/mixin/LivingEntityMixin.java b/src/main/java/me/retucio/sputnik/mixin/LivingEntityMixin.java index af0585b..17af2d6 100644 --- a/src/main/java/me/retucio/sputnik/mixin/LivingEntityMixin.java +++ b/src/main/java/me/retucio/sputnik/mixin/LivingEntityMixin.java @@ -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; diff --git a/src/main/java/me/retucio/sputnik/mixin/TridentItemMixin.java b/src/main/java/me/retucio/sputnik/mixin/TridentItemMixin.java new file mode 100644 index 0000000..23571ef --- /dev/null +++ b/src/main/java/me/retucio/sputnik/mixin/TridentItemMixin.java @@ -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; + } +} diff --git a/src/main/java/me/retucio/sputnik/mixin/accessor/AbstractBlockAccessor.java b/src/main/java/me/retucio/sputnik/mixin/accessor/AbstractBlockAccessor.java new file mode 100644 index 0000000..f779a01 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/mixin/accessor/AbstractBlockAccessor.java @@ -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); +} diff --git a/src/main/java/me/retucio/sputnik/module/Category.java b/src/main/java/me/retucio/sputnik/module/Category.java index 07f5f6a..82861b2 100644 --- a/src/main/java/me/retucio/sputnik/module/Category.java +++ b/src/main/java/me/retucio/sputnik/module/Category.java @@ -4,6 +4,7 @@ public enum Category { PLAYER("jugador"), WORLD("mundo"), + MOVEMENT("movimiento"), CAMERA("cámara"), RENDER("renderizado"), diff --git a/src/main/java/me/retucio/sputnik/module/ModuleManager.java b/src/main/java/me/retucio/sputnik/module/ModuleManager.java index e3d32a4..98dd3b6 100644 --- a/src/main/java/me/retucio/sputnik/module/ModuleManager.java +++ b/src/main/java/me/retucio/sputnik/module/ModuleManager.java @@ -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 getModules() { diff --git a/src/main/java/me/retucio/sputnik/module/modules/client/GUI.java b/src/main/java/me/retucio/sputnik/module/modules/client/GUI.java index 032080b..0d2a38a 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/client/GUI.java +++ b/src/main/java/me/retucio/sputnik/module/modules/client/GUI.java @@ -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", diff --git a/src/main/java/me/retucio/sputnik/module/modules/misc/UnfocusedCpu.java b/src/main/java/me/retucio/sputnik/module/modules/misc/UnfocusedCpu.java new file mode 100644 index 0000000..e3078ac --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/misc/UnfocusedCpu.java @@ -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); + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/movement/BoatFly.java b/src/main/java/me/retucio/sputnik/module/modules/movement/BoatFly.java new file mode 100644 index 0000000..f58154c --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/BoatFly.java @@ -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(); + } + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/movement/Dolphin.java b/src/main/java/me/retucio/sputnik/module/modules/movement/Dolphin.java new file mode 100644 index 0000000..3958757 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/Dolphin.java @@ -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(); + } + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/ElytraBounce.java b/src/main/java/me/retucio/sputnik/module/modules/movement/ElytraBounce.java similarity index 96% rename from src/main/java/me/retucio/sputnik/module/modules/player/ElytraBounce.java rename to src/main/java/me/retucio/sputnik/module/modules/movement/ElytraBounce.java index c14d3c1..e3feee8 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/ElytraBounce.java +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/ElytraBounce.java @@ -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() { diff --git a/src/main/java/me/retucio/sputnik/module/modules/movement/ElytraFly.java b/src/main/java/me/retucio/sputnik/module/modules/movement/ElytraFly.java new file mode 100644 index 0000000..a09a065 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/ElytraFly.java @@ -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; + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/Headhitters.java b/src/main/java/me/retucio/sputnik/module/modules/movement/Headhitters.java similarity index 87% rename from src/main/java/me/retucio/sputnik/module/modules/player/Headhitters.java rename to src/main/java/me/retucio/sputnik/module/modules/movement/Headhitters.java index e2e014d..102d988 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/Headhitters.java +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/Headhitters.java @@ -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 diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/InfiniteElytra.java b/src/main/java/me/retucio/sputnik/module/modules/movement/InfiniteElytra.java similarity index 97% rename from src/main/java/me/retucio/sputnik/module/modules/player/InfiniteElytra.java rename to src/main/java/me/retucio/sputnik/module/modules/movement/InfiniteElytra.java index 7c80d4f..e085a8b 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/InfiniteElytra.java +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/InfiniteElytra.java @@ -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); } diff --git a/src/main/java/me/retucio/sputnik/module/modules/movement/Jesus.java b/src/main/java/me/retucio/sputnik/module/modules/movement/Jesus.java new file mode 100644 index 0000000..49e2dcd --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/Jesus.java @@ -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 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; } + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/ReverseStep.java b/src/main/java/me/retucio/sputnik/module/modules/movement/ReverseStep.java similarity index 96% rename from src/main/java/me/retucio/sputnik/module/modules/player/ReverseStep.java rename to src/main/java/me/retucio/sputnik/module/modules/movement/ReverseStep.java index d9efcfc..68c3fba 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/ReverseStep.java +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/ReverseStep.java @@ -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 ); } diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/SafeWalk.java b/src/main/java/me/retucio/sputnik/module/modules/movement/SafeWalk.java similarity index 95% rename from src/main/java/me/retucio/sputnik/module/modules/player/SafeWalk.java rename to src/main/java/me/retucio/sputnik/module/modules/movement/SafeWalk.java index 8461cd8..fcd39b3 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/SafeWalk.java +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/SafeWalk.java @@ -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 diff --git a/src/main/java/me/retucio/sputnik/module/modules/movement/Slippy.java b/src/main/java/me/retucio/sputnik/module/modules/movement/Slippy.java new file mode 100644 index 0000000..ad96147 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/Slippy.java @@ -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 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()); + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/Step.java b/src/main/java/me/retucio/sputnik/module/modules/movement/Step.java similarity index 80% rename from src/main/java/me/retucio/sputnik/module/modules/player/Step.java rename to src/main/java/me/retucio/sputnik/module/modules/movement/Step.java index 6361ab3..7572406 100644 --- a/src/main/java/me/retucio/sputnik/module/modules/player/Step.java +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/Step.java @@ -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); } } diff --git a/src/main/java/me/retucio/sputnik/module/modules/movement/TridentBoost.java b/src/main/java/me/retucio/sputnik/module/modules/movement/TridentBoost.java new file mode 100644 index 0000000..0a2daa3 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/movement/TridentBoost.java @@ -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); + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/network/PacketMine.java b/src/main/java/me/retucio/sputnik/module/modules/network/PacketMine.java new file mode 100644 index 0000000..bf51503 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/network/PacketMine.java @@ -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 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 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 + ); + } + } +} \ No newline at end of file diff --git a/src/main/java/me/retucio/sputnik/module/modules/player/MaceKill.java b/src/main/java/me/retucio/sputnik/module/modules/player/MaceKill.java new file mode 100644 index 0000000..1886d76 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/player/MaceKill.java @@ -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); + } +} diff --git a/src/main/java/me/retucio/sputnik/module/modules/world/BlockInfo.java b/src/main/java/me/retucio/sputnik/module/modules/world/BlockInfo.java new file mode 100644 index 0000000..300eaf5 --- /dev/null +++ b/src/main/java/me/retucio/sputnik/module/modules/world/BlockInfo.java @@ -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 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> 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> 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; } + } +} diff --git a/src/main/resources/sputnik.accesswidener b/src/main/resources/sputnik.accesswidener index 73c9aff..e56d4bf 100644 --- a/src/main/resources/sputnik.accesswidener +++ b/src/main/resources/sputnik.accesswidener @@ -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 (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 (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; diff --git a/src/main/resources/sputnik.mixins.json b/src/main/resources/sputnik.mixins.json index d14dda6..ed4e2ec 100644 --- a/src/main/resources/sputnik.mixins.json +++ b/src/main/resources/sputnik.mixins.json @@ -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"