This commit is contained in:
retuci0 committed 2026-02-27 18:06:32 +01:00
1 parent 412fe93a89
commit 4d30a16a6a
48 files changed
+435 -173

No files matched your search

+5 -8
View File
@@ -1,21 +1,18 @@
# v3.5 # v3.7
## novedades ## novedades
### adiciones ### adiciones
#### comandos nuevos:
- repesperar: combinación de \$repetir y \$esperar
#### módulos nuevos: #### módulos nuevos:
- andamios: coloca bloques a tus pies a medida que caminas - trazos: dibuja líneas apuntando a entidades cercanas
- cocaína: hace que todo vaya más rápido o más lento
### arreglos / mejoras ### arreglos / mejoras
- opción para no romper el pico en selección de minado - la config. ya funciona de nuevo
- la escucha de eventos ha sido arreglada, arreglando cosas como la ruedita del zoom y algunos comandos
- selección de minado ya no crashea al no usar pico
## problemas reconocidos ## problemas reconocidos
+1 -1
View File
@@ -10,6 +10,6 @@ fabric_api_version=0.140.2+1.21.11
neutrino_version=1.1.0 neutrino_version=1.1.0
mod_version=3.6 mod_version=3.7
maven_group=me.retucio maven_group=me.retucio
archives_base_name=sputnik archives_base_name=sputnik
@@ -1,6 +1,7 @@
package me.retucio.sputnik; package me.retucio.sputnik;
import com.github.retucio.neutrino.EventBus; import com.github.retucio.neutrino.EventBus;
import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.cape.CapeManager; import me.retucio.sputnik.cape.CapeManager;
import me.retucio.sputnik.command.CommandManager; import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.command.commands.BindCommand; import me.retucio.sputnik.command.commands.BindCommand;
@@ -235,6 +236,7 @@ public class Sputnik implements ClientModInitializer {
|| mc.currentScreen instanceof AbstractCommandBlockScreen; || mc.currentScreen instanceof AbstractCommandBlockScreen;
} }
@EventListener
// notificar al usuario de que hay una actualización disponible, si la hay // notificar al usuario de que hay una actualización disponible, si la hay
public void onSetScreen(OpenScreenEvent event) { public void onSetScreen(OpenScreenEvent event) {
if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) { if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) {
@@ -244,6 +246,7 @@ public class Sputnik implements ClientModInitializer {
} }
} }
@EventListener
public void onStop(ShutdownEvent event) { public void onStop(ShutdownEvent event) {
ConfigManager.save(); ConfigManager.save();
} }
@@ -1,5 +1,6 @@
package me.retucio.sputnik.command.commands; package me.retucio.sputnik.command.commands;
import com.github.retucio.neutrino.EventListener;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command; import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.event.TickEvent; import me.retucio.sputnik.event.TickEvent;
@@ -34,6 +35,7 @@ public class EnderChestCommand extends Command {
}); });
} }
@EventListener
public void onTick(TickEvent.Post event) { public void onTick(TickEvent.Post event) {
if (shouldOpenEchest) { if (shouldOpenEchest) {
shouldOpenEchest = false; shouldOpenEchest = false;
@@ -1,5 +1,6 @@
package me.retucio.sputnik.command.commands; package me.retucio.sputnik.command.commands;
import com.github.retucio.neutrino.EventListener;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command; import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.EntityArgumentType; import me.retucio.sputnik.command.args.EntityArgumentType;
@@ -37,6 +38,7 @@ public class SpectateCommand extends Command {
); );
} }
@EventListener
public void onKey(KeyEvent event) { public void onKey(KeyEvent event) {
if (mc.getCameraEntity() != mc.player && mc.currentScreen == null if (mc.getCameraEntity() != mc.player && mc.currentScreen == null
&& event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) { && event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) {
@@ -1,5 +1,6 @@
package me.retucio.sputnik.config; package me.retucio.sputnik.config;
import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.event.sputnik.*; import me.retucio.sputnik.event.sputnik.*;
import me.retucio.sputnik.module.setting.settings.*; import me.retucio.sputnik.module.setting.settings.*;
import me.retucio.sputnik.ui.screen.ClickGUI; import me.retucio.sputnik.ui.screen.ClickGUI;
@@ -43,11 +44,13 @@ public class ClientConfig {
EVENT_BUS.subscribe(this); EVENT_BUS.subscribe(this);
} }
@EventListener
public void onToggleModule(ToggleModuleEvent event) { public void onToggleModule(ToggleModuleEvent event) {
ConfigManager.setModuleState(event.getModule()); ConfigManager.setModuleState(event.getModule());
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@EventListener
public void onUpdateSetting(UpdateSettingEvent event) { public void onUpdateSetting(UpdateSettingEvent event) {
if (mc == null || !event.shouldSave()) return; if (mc == null || !event.shouldSave()) return;
@@ -68,20 +71,24 @@ public class ClientConfig {
ConfigManager.setSetting(event.getSetting(), value); ConfigManager.setSetting(event.getSetting(), value);
} }
@EventListener
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) { public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
ConfigManager.setFramePosition(event.getFrame()); ConfigManager.setFramePosition(event.getFrame());
} }
@EventListener
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) { public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
settingsFrames.remove(event.getFrame().getModule().getName()); settingsFrames.remove(event.getFrame().getModule().getName());
ConfigManager.save(); ConfigManager.save();
} }
@EventListener
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) { public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()}); settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()});
ConfigManager.save(); ConfigManager.save();
} }
@EventListener
public void onExtendModuleFrame(ModuleFrameEvent.Extend event) { public void onExtendModuleFrame(ModuleFrameEvent.Extend event) {
extendableFrames.put("M", new FrameData( extendableFrames.put("M", new FrameData(
ClickGUI.INSTANCE.getModulesFrame().getX(), ClickGUI.INSTANCE.getModulesFrame().getX(),
@@ -89,6 +96,7 @@ public class ClientConfig {
ClickGUI.INSTANCE.getModulesFrame().extended)); ClickGUI.INSTANCE.getModulesFrame().extended));
} }
@EventListener
public void onMoveModuleFrame(ModuleFrameEvent.Move event) { public void onMoveModuleFrame(ModuleFrameEvent.Move event) {
extendableFrames.replace("M", new FrameData( extendableFrames.replace("M", new FrameData(
ClickGUI.INSTANCE.getModulesFrame().getX(), ClickGUI.INSTANCE.getModulesFrame().getX(),
@@ -96,6 +104,7 @@ public class ClientConfig {
ClickGUI.INSTANCE.getModulesFrame().extended)); ClickGUI.INSTANCE.getModulesFrame().extended));
} }
@EventListener
public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) { public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) {
extendableFrames.put("S", new FrameData( extendableFrames.put("S", new FrameData(
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(), ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
@@ -103,6 +112,7 @@ public class ClientConfig {
ClickGUI.INSTANCE.getGuiSettingsFrame().extended)); ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
} }
@EventListener
public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) { public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) {
extendableFrames.replace("S", new FrameData( extendableFrames.replace("S", new FrameData(
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(), ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
@@ -2,9 +2,9 @@ package me.retucio.sputnik.mixin.mixins.screen;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local; import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.mixin.accessors.KeyBindingAccessor;
import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.inventory.CreativeInventoryHotbarKeybinds; import me.retucio.sputnik.module.modules.inventory.CreativeInventoryHotbarKeybinds;
import me.retucio.sputnik.util.KeyUtil;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.client.input.KeyInput; import net.minecraft.client.input.KeyInput;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -20,9 +20,7 @@ public abstract class CreativeInventoryScreenMixin {
@ModifyExpressionValue(method = "keyPressed", at = @At(value = "INVOKE", target = "Ljava/util/OptionalInt;isPresent()Z")) @ModifyExpressionValue(method = "keyPressed", at = @At(value = "INVOKE", target = "Ljava/util/OptionalInt;isPresent()Z"))
private boolean makeHotkeysWork(boolean original, @Local(argsOnly = true) KeyInput input) { private boolean makeHotkeysWork(boolean original, @Local(argsOnly = true) KeyInput input) {
if (ModuleManager.INSTANCE.getModuleByClass(CreativeInventoryHotbarKeybinds.class).isEnabled()) if (ModuleManager.INSTANCE.getModuleByClass(CreativeInventoryHotbarKeybinds.class).isEnabled())
return Arrays.stream(mc.options.hotbarKeys).anyMatch( return Arrays.stream(mc.options.hotbarKeys).anyMatch(keyBinding -> KeyUtil.getKey(keyBinding) == input.getKeycode());
keyBinding -> ((KeyBindingAccessor) keyBinding).getBoundKey().getCode() == input.getKeycode()
);
return original; return original;
} }
} }
@@ -159,6 +159,7 @@ public class ModuleManager {
add(new Nametags()); add(new Nametags());
add(new NoRender()); add(new NoRender());
add(new Particles()); add(new Particles());
add(new Tracers());
} }
private void addWorld() { private void addWorld() {
@@ -8,6 +8,11 @@ import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
/**
* @author retucio
*/
public class Autism extends Module { public class Autism extends Module {
private final NumberSetting interval = sgGeneral.add(new NumberSetting( private final NumberSetting interval = sgGeneral.add(new NumberSetting(
@@ -47,6 +47,8 @@ import org.lwjgl.glfw.GLFW;
* @see KeyInputMixin * @see KeyInputMixin
* @see LivingEntityRendererMixin * @see LivingEntityRendererMixin
* @see WorldRendererMixin * @see WorldRendererMixin
*
* @author retucio
*/ */
public class Freecam extends Module { public class Freecam extends Module {
@@ -14,6 +14,8 @@ import org.lwjgl.glfw.GLFW;
/** continúa en: /** continúa en:
* @see CameraMixin * @see CameraMixin
* @see EntityMixin * @see EntityMixin
*
* @author retucio
*/ */
public class Freelook extends Module { public class Freelook extends Module {
@@ -15,13 +15,24 @@ import java.awt.*;
/** continúa en: /** continúa en:
* @see LightmapTextureManagerMixin * @see LightmapTextureManagerMixin
*
* @author retucio
*/ */
public class Fullbright extends Module { public class Fullbright extends Module {
public final EnumSetting<Modes> mode = sgGeneral.add(new EnumSetting<>("modo", "qué modo de iluminación emplear (usar poción con shaders)", Modes.class, Modes.GAMMA)); public final EnumSetting<Modes> mode = sgGeneral.add(new EnumSetting<>(
"modo",
"qué modo de iluminación emplear (usar poción con shaders)",
Modes.class, Modes.GAMMA
));
public final ColorSetting color = sgGeneral.add(new ColorSetting("filtro", "filtro de color", new Color(255, 255, 255, 255), false)); public final ColorSetting color = sgGeneral.add(new ColorSetting(
"filtro",
"filtro de color",
new Color(255, 255, 255, 255),
false
)).visibility(() -> mode.is(Modes.GAMMA));
public Fullbright() { public Fullbright() {
super("brilli brilli", super("brilli brilli",
@@ -32,7 +43,6 @@ public class Fullbright extends Module {
mode.onUpdate(mode -> { if (mode != Modes.POTION) disableNightVision(); }); mode.onUpdate(mode -> { if (mode != Modes.POTION) disableNightVision(); });
mode.onUpdate(mode -> { mode.onUpdate(mode -> {
boolean v = mode.equals(Modes.GAMMA); boolean v = mode.equals(Modes.GAMMA);
color.setVisible(v);
if (v) disableNightVision(); if (v) disableNightVision();
}); });
} }
@@ -11,7 +11,13 @@ import me.retucio.sputnik.module.setting.settings.KeySetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
// continúa en CameraMixin
/** continúa en:
* @see me.retucio.sputnik.mixin.mixins.render.CameraMixin
*
* @author retucio
*/
public class PerspectivePlus extends Module { public class PerspectivePlus extends Module {
// ajustes // ajustes
@@ -8,6 +8,10 @@ import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
/**
* @author retucio
*/
public class Rotations extends Module { public class Rotations extends Module {
private final NumberSetting yaw = sgGeneral.add(new NumberSetting("guiñada", "eje vertical - giro horizontal (yaw)", 0, -180, 180, 1)); private final NumberSetting yaw = sgGeneral.add(new NumberSetting("guiñada", "eje vertical - giro horizontal (yaw)", 0, -180, 180, 1));
@@ -11,7 +11,13 @@ import me.retucio.sputnik.module.setting.settings.KeySetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
// continúa en GameRendererMixin
/** continúa en:
* @see me.retucio.sputnik.mixin.mixins.render.GameRendererMixin
*
* @author retucio
*/
public class Zoom extends Module { public class Zoom extends Module {
private final SettingGroup sgVisual = addSg(new SettingGroup("visual", true)); private final SettingGroup sgVisual = addSg(new SettingGroup("visual", true));
@@ -87,6 +93,7 @@ public class Zoom extends Module {
mc.options.getMouseSensitivity().setValue(prevMouseSens * mouseSensMultiplier.getValue()); mc.options.getMouseSensitivity().setValue(prevMouseSens * mouseSensMultiplier.getValue());
} }
@EventListener
private void onMouseScroll(MouseScrollEvent event) { private void onMouseScroll(MouseScrollEvent event) {
boolean key = scrollKey.getValue() == GLFW.GLFW_KEY_UNKNOWN || scrollKey.isDown(); boolean key = scrollKey.getValue() == GLFW.GLFW_KEY_UNKNOWN || scrollKey.isDown();
if (isEnabled() && scrollSens.getValue() > 0 && key) { if (isEnabled() && scrollSens.getValue() > 0 && key) {
@@ -17,6 +17,10 @@ import me.retucio.sputnik.module.setting.settings.StringSetting;
import me.retucio.sputnik.util.ChatUtil; import me.retucio.sputnik.util.ChatUtil;
/**
* @author retucio
*/
public class DiscordRPC extends Module { public class DiscordRPC extends Module {
private final SettingGroup sgImage = addSg(new SettingGroup("imágenes", false)); private final SettingGroup sgImage = addSg(new SettingGroup("imágenes", false));
@@ -21,7 +21,11 @@ import org.lwjgl.glfw.GLFW;
import java.awt.*; import java.awt.*;
// módulo no visible solo para los ajustes de la interfaz (y del cliente en general)
/** módulo no visible solo para los ajustes del mod
* @author retucio
*/
public class GUI extends Module { public class GUI extends Module {
private final SettingGroup sgWidgets = addSg(new SettingGroup("widgets", true)); private final SettingGroup sgWidgets = addSg(new SettingGroup("widgets", true));
@@ -62,7 +66,7 @@ public class GUI extends Module {
"distinguir mayúsculas", "distinguir mayúsculas",
"la búsqueda es sensible a mayúsculas y minúsculas", "la búsqueda es sensible a mayúsculas y minúsculas",
false false
)); )).visibility(searchBar::getValue);
// ^^^ no sé de qué sirve porque está todo en minúsculas pero bueno // ^^^ no sé de qué sirve porque está todo en minúsculas pero bueno
public final BooleanSetting blur = sgUi.add(new BooleanSetting( public final BooleanSetting blur = sgUi.add(new BooleanSetting(
@@ -112,9 +116,9 @@ public class GUI extends Module {
GLFW.GLFW_KEY_RIGHT_SHIFT); GLFW.GLFW_KEY_RIGHT_SHIFT);
Sputnik.EVENT_BUS.subscribe(this); Sputnik.EVENT_BUS.subscribe(this);
keyMode.setVisible(false);
notify.setVisible(false); keyMode.visibility(false);
searchBar.onUpdate(v -> matchCase.setVisible(v)); notify.visibility(false);
} }
@EventListener @EventListener
@@ -12,10 +12,13 @@ import org.lwjgl.glfw.GLFW;
import java.awt.*; import java.awt.*;
/** lógica del HUD manejada en: /** lógica del HUD manejada en:
* @see HudRenderer * @see HudRenderer
* @see HudElement * @see HudElement
* @see HudEditorScreen * @see HudEditorScreen
*
* @author retucio
*/ */
public class HUD extends Module { public class HUD extends Module {
@@ -30,11 +33,13 @@ public class HUD extends Module {
"tecla asignada al editor de elementos del hud", "tecla asignada al editor de elementos del hud",
GLFW.GLFW_KEY_PAGE_UP GLFW.GLFW_KEY_PAGE_UP
)); ));
public BooleanSetting axialMovement = sgEditor.add(new BooleanSetting( public BooleanSetting axialMovement = sgEditor.add(new BooleanSetting(
"movimiento axial", "movimiento axial",
"te permite mover los elementos sobre los ejes más fácilmente", "te permite mover los elementos sobre los ejes más fácilmente",
true true
)); ));
public NumberSetting axisOffset = sgEditor.add(new NumberSetting( public NumberSetting axisOffset = sgEditor.add(new NumberSetting(
"offset de los ejes", "offset de los ejes",
"offset a tener en cuenta al usar el movimiento axial", "offset a tener en cuenta al usar el movimiento axial",
@@ -42,12 +47,14 @@ public class HUD extends Module {
0, 0,
50, 50,
1 1
)); )).visibility(axialMovement::getValue);
public BooleanSetting arrowMovement = sgEditor.add(new BooleanSetting( public BooleanSetting arrowMovement = sgEditor.add(new BooleanSetting(
"movimiento con flechas", "movimiento con flechas",
"te permite mover el elemento seleccionado con las teclas de las flechas", "te permite mover el elemento seleccionado con las teclas de las flechas",
true true
)); ));
public NumberSetting arrowOffset = sgEditor.add(new NumberSetting( public NumberSetting arrowOffset = sgEditor.add(new NumberSetting(
"cuánto mover con las flechas", "cuánto mover con las flechas",
"cuántos píxeles mover el elemento seleccionado al usar las flechas", "cuántos píxeles mover el elemento seleccionado al usar las flechas",
@@ -55,7 +62,7 @@ public class HUD extends Module {
1, 1,
20, 20,
1 1
)); )).visibility(arrowMovement::getValue);
// renderizado // renderizado
public ColorSetting color = sgDisplay.add(new ColorSetting( public ColorSetting color = sgDisplay.add(new ColorSetting(
@@ -63,16 +70,19 @@ public class HUD extends Module {
"color del texto de los elementos del HUD", "color del texto de los elementos del HUD",
new Color(255, 255, 255, 255), false) new Color(255, 255, 255, 255), false)
); );
public BooleanSetting shadow = sgDisplay.add(new BooleanSetting( public BooleanSetting shadow = sgDisplay.add(new BooleanSetting(
"sombra", "sombra",
"texto con sombra", "texto con sombra",
true true
)); ));
public BooleanSetting showOnF3 = sgDisplay.add(new BooleanSetting( public BooleanSetting showOnF3 = sgDisplay.add(new BooleanSetting(
"mostrar en F3", "mostrar en F3",
"renderizar HUD en el menú de debug", "renderizar HUD en el menú de debug",
false false
)); ));
public BooleanSetting showOnChat = sgDisplay.add(new BooleanSetting( public BooleanSetting showOnChat = sgDisplay.add(new BooleanSetting(
"mostrar en chat", "mostrar en chat",
"renderizar HUD en la pantalla del chat", "renderizar HUD en la pantalla del chat",
@@ -88,24 +98,28 @@ public class HUD extends Module {
6, 6,
1 1
)); ));
public EnumSetting<TimeFormat> timeFormat = sgElements.add(new EnumSetting<>( public EnumSetting<TimeFormat> timeFormat = sgElements.add(new EnumSetting<>(
"formato de la hora", "formato de la hora",
"12h o 24h", "12h o 24h",
TimeFormat.class, TimeFormat.class,
TimeFormat.TWENTY_FOUR_HOUR TimeFormat.TWENTY_FOUR_HOUR
)); ));
public StringSetting customText = sgElements.add(new StringSetting( public StringSetting customText = sgElements.add(new StringSetting(
"texto custom", "texto custom",
"marca de agua (dejar vacío para quitar)", "marca de agua (dejar vacío para quitar)",
"adolf jitler inshtagram feishbuc twiter", "adolf jitler inshtagram feishbuc twiter",
40 40
)); ));
public EnumSetting<CoordsMode> coordsMode = sgElements.add(new EnumSetting<>( public EnumSetting<CoordsMode> coordsMode = sgElements.add(new EnumSetting<>(
"modo de coordenadas", "modo de coordenadas",
"qué coordenadas mostrar", "qué coordenadas mostrar",
CoordsMode.class, CoordsMode.class,
CoordsMode.OVERWORLD CoordsMode.OVERWORLD
)); ));
public EnumSetting<Dynosaurs> dyno = sgElements.add(new EnumSetting<>( public EnumSetting<Dynosaurs> dyno = sgElements.add(new EnumSetting<>(
"dinosaurio", "dinosaurio",
"qué dinosaurio mostrar", "qué dinosaurio mostrar",
@@ -119,9 +133,6 @@ public class HUD extends Module {
GLFW.GLFW_KEY_F12 GLFW.GLFW_KEY_F12
); );
axialMovement.onUpdate(v -> axisOffset.setVisible(v));
arrowMovement.onUpdate(v -> arrowOffset.setVisible(v));
dyno.onUpdate(v -> { dyno.onUpdate(v -> {
DynoElement element = (DynoElement) HudRenderer.getElement(DynoElement.class); DynoElement element = (DynoElement) HudRenderer.getElement(DynoElement.class);
if (element != null) element.reloadTexture(); if (element != null) element.reloadTexture();
@@ -7,11 +7,30 @@ import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.BooleanSetting; import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
/**
* @author retucio
*/
public class AttributeSwapper extends Module { public class AttributeSwapper extends Module {
private final NumberSetting slot = sgGeneral.add(new NumberSetting("slot", "slot al que cambiar", 1, 1, 9, 1)); private final NumberSetting slot = sgGeneral.add(new NumberSetting(
private final BooleanSetting swap = sgGeneral.add(new BooleanSetting("cambiar de vuelta", "volver al slot inicial tras haber aplicado el swapping", true)); "slot",
private final NumberSetting swapDelay = sgGeneral.add(new NumberSetting("delay de cambio de vuelta", "tiempo que se tarda en volver al slot inicial", 1, 1, 20, 1)); "slot al que cambiar",
1, 1, 9, 1
));
private final BooleanSetting swap = sgGeneral.add(new BooleanSetting(
"cambiar de vuelta",
"volver al slot inicial tras haber aplicado el swapping",
true
));
private final NumberSetting swapDelay = sgGeneral.add(new NumberSetting(
"delay de cambio de vuelta",
"tiempo que se tarda en volver al slot inicial",
1, 1, 20, 1
));
private int delay = 0; private int delay = 0;
private int prevSlot = -1; private int prevSlot = -1;
@@ -17,7 +17,12 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
// https://github.com/etianl/Trouser-Streak/blob/ce27abd30435ca2b43a5e5546f5b070c07c6291a/src/main/java/pwn/noobs/trouserstreak/modules/MaceKill.java /**
* @link <a href="https://github.com/etianl/Trouser-Streak/blob/ce27abd30435ca2b43a5e5546f5b070c07c6291a/src/main/java/pwn/noobs/trouserstreak/modules/MaceKill.java">créditos a etianl</a>
*
* @"author" retucio
*/
public class MaceKill extends Module { public class MaceKill extends Module {
private final BooleanSetting max = sgGeneral.add(new BooleanSetting( private final BooleanSetting max = sgGeneral.add(new BooleanSetting(
@@ -33,7 +38,7 @@ public class MaceKill extends Module {
1, 1,
170, 170,
1 1
)); )).visibility(() -> !max.getValue());
private final BooleanSetting preventDeath = sgGeneral.add(new BooleanSetting( private final BooleanSetting preventDeath = sgGeneral.add(new BooleanSetting(
"prevenir muerte", "prevenir muerte",
@@ -43,11 +48,10 @@ public class MaceKill extends Module {
public MaceKill() { public MaceKill() {
super("estampaescrotos", "estampa escrotos ajenos", Category.COMBAT); super("estampaescrotos", "estampa escrotos ajenos", Category.COMBAT);
max.onUpdate(v -> height.setVisible(!v));
} }
@SuppressWarnings("ConstantConditions")
@EventListener @EventListener
@SuppressWarnings("ConstantConditions")
private void onPacketSend(PacketEvent.Send event) { private void onPacketSend(PacketEvent.Send event) {
if (mc.player == null) return; if (mc.player == null) return;
if (mc.player.getMainHandStack().getItem() == Items.MACE if (mc.player.getMainHandStack().getItem() == Items.MACE
@@ -35,7 +35,12 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
// https://github.com/maDU59/ProjectilesTrajectoryPreview /**
* @link <a href="https://github.com/maDU59/ProjectilesTrajectoryPreview">créditos a maDU59</a>
*
* @"author" retucio
*/
public class ProjectileTrajectories extends Module { public class ProjectileTrajectories extends Module {
private final SettingGroup sgTrajectory = addSg(new SettingGroup("trayectoria", true)); private final SettingGroup sgTrajectory = addSg(new SettingGroup("trayectoria", true));
@@ -114,10 +119,10 @@ public class ProjectileTrajectories extends Module {
public ProjectileTrajectories() { public ProjectileTrajectories() {
super("trayectoria", "muestra la trayectoria de los proyectiles", Category.COMBAT); super("trayectoria", "muestra la trayectoria de los proyectiles", Category.COMBAT);
fillingTargets.onUpdate(v -> fillingColor.setVisible(v != TrajectoryTargets.NONE)); fillingTargets.onUpdate(v -> fillingColor.visibility(v != TrajectoryTargets.NONE));
outlineTargets.onUpdate(v -> { outlineTargets.onUpdate(v -> {
outlineColor.setVisible(v != TrajectoryTargets.NONE); outlineColor.visibility(v != TrajectoryTargets.NONE);
outlineWidth.setVisible(v != TrajectoryTargets.NONE); outlineWidth.visibility(v != TrajectoryTargets.NONE);
}); });
} }
@@ -15,7 +15,13 @@ import net.minecraft.world.RaycastContext;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
// https://github.com/etianl/spearHax/blob/main/src/main/java/things/haxHandler.java
/**
* @link <a href="https://github.com/etianl/spearHax/blob/main/src/main/java/things/haxHandler.java">créditos a etianl</a>
*
* @"author" retucio
*/
public class SpearKill extends Module { public class SpearKill extends Module {
private final BooleanSetting onlyPlayers = sgGeneral.add(new BooleanSetting( private final BooleanSetting onlyPlayers = sgGeneral.add(new BooleanSetting(
@@ -5,10 +5,12 @@ import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.Module;
/** /** continúa en
* continúa en
* @see CreativeInventoryScreenMixin * @see CreativeInventoryScreenMixin
*
* @author retucio
*/ */
public class CreativeInventoryHotbarKeybinds extends Module { public class CreativeInventoryHotbarKeybinds extends Module {
public CreativeInventoryHotbarKeybinds() { public CreativeInventoryHotbarKeybinds() {
@@ -14,6 +14,10 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.screen.slot.Slot; import net.minecraft.screen.slot.Slot;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
/**
* @author retucio
*/
public class InventoryPlus extends Module { public class InventoryPlus extends Module {
private final KeySetting row1key = sgGeneral.add(new KeySetting("fila 1", "tecla para mover items a la primera fila", GLFW.GLFW_KEY_A)); private final KeySetting row1key = sgGeneral.add(new KeySetting("fila 1", "tecla para mover items a la primera fila", GLFW.GLFW_KEY_A));
@@ -14,6 +14,10 @@ import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
/**
* @author retucio
*/
public class Offhand extends Module { public class Offhand extends Module {
private final OptionSetting<Item> item = sgGeneral.add(new OptionSetting<>( private final OptionSetting<Item> item = sgGeneral.add(new OptionSetting<>(
@@ -1,6 +1,5 @@
package me.retucio.sputnik.module.modules.inventory; package me.retucio.sputnik.module.modules.inventory;
import me.retucio.sputnik.mixin.accessors.KeyBindingAccessor;
import me.retucio.sputnik.module.Category; import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.ListSetting; import me.retucio.sputnik.module.setting.settings.ListSetting;
@@ -78,8 +77,7 @@ public class UIMove extends Module {
if (handler == null || !screens.isEnabled(handler)) return; if (handler == null || !screens.isEnabled(handler)) return;
for (KeyBinding kb : movementKeys) { for (KeyBinding kb : movementKeys) {
kb.setPressed(KeyUtil.isKeyDown(( kb.setPressed(KeyUtil.isKeyDown(KeyUtil.getKey(kb)));
(KeyBindingAccessor) kb).getBoundKey().getCode()));
} }
} }
@@ -67,7 +67,7 @@ public class ChatPlus extends Module {
Category.MISC); Category.MISC);
updateDateFormat(); updateDateFormat();
updateClientName(); updateClientName();
timestamps.onUpdate(v -> timestampSecs.setVisible(v)); timestamps.onUpdate(v -> timestampSecs.visibility(v));
timestampSecs.onUpdate(x -> updateDateFormat()); timestampSecs.onUpdate(x -> updateDateFormat());
} }
@@ -172,19 +172,19 @@ public class Scaffold extends Module {
public Scaffold() { public Scaffold() {
super("andamios", "pone bloques bajo tus pies de manera automática", Category.MOVEMENT); super("andamios", "pone bloques bajo tus pies de manera automática", Category.MOVEMENT);
extend.onUpdate(extendDistance::setVisible); extend.onUpdate(extendDistance::visibility);
tower.onUpdate(v -> { tower.onUpdate(v -> {
towerSpeed.setVisible(v); towerSpeed.visibility(v);
towerWhileMoving.setVisible(v); towerWhileMoving.visibility(v);
}); });
outlines.onUpdate(v -> { outlines.onUpdate(v -> {
outlineColor.setVisible(v); outlineColor.visibility(v);
lineWidth.setVisible(v); lineWidth.visibility(v);
}); });
fillings.onUpdate(fillingColor::setVisible); fillings.onUpdate(fillingColor::visibility);
} }
@@ -330,7 +330,7 @@ public class Scaffold extends Module {
public enum ListMode { public enum ListMode {
WHITELIST("lista blanca (incluir)"), WHITELIST("lista blanca (incluir)"),
BLACKLIST("lista negra (excluir"); BLACKLIST("lista negra (excluir)");
private final String name; private final String name;
ListMode(String name) { this.name = name; } ListMode(String name) { this.name = name; }
@@ -60,13 +60,13 @@ public class LogoutSpots extends Module {
Category.NETWORK); Category.NETWORK);
outlines.onUpdate(v -> { outlines.onUpdate(v -> {
outlineColor.setVisible(v); outlineColor.visibility(v);
fullHeight.setVisible(v || filling.getValue()); fullHeight.visibility(v || filling.getValue());
}); });
filling.onUpdate(v -> { filling.onUpdate(v -> {
fillingColor.setVisible(v); fillingColor.visibility(v);
fullHeight.setVisible(v || outlines.getValue()); fullHeight.visibility(v || outlines.getValue());
}); });
dummy.onUpdate(v -> { dummy.onUpdate(v -> {
@@ -1,6 +1,7 @@
package me.retucio.sputnik.module.modules.network; package me.retucio.sputnik.module.modules.network;
import com.github.retucio.neutrino.EventListener; import com.github.retucio.neutrino.EventListener;
import it.unimi.dsi.fastutil.booleans.BooleanSet;
import me.retucio.sputnik.event.interact.AttackBlockEvent; import me.retucio.sputnik.event.interact.AttackBlockEvent;
import me.retucio.sputnik.event.render.Render3DEvent; import me.retucio.sputnik.event.render.Render3DEvent;
import me.retucio.sputnik.module.Category; import me.retucio.sputnik.module.Category;
@@ -11,10 +12,16 @@ import me.retucio.sputnik.module.setting.settings.ColorSetting;
import me.retucio.sputnik.module.setting.settings.EnumSetting; import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.ChatUtil; import me.retucio.sputnik.util.ChatUtil;
import me.retucio.sputnik.util.EntityUtil;
import me.retucio.sputnik.util.MiscUtil;
import me.retucio.sputnik.util.render.RenderUtil; import me.retucio.sputnik.util.render.RenderUtil;
import net.minecraft.command.argument.EntityAnchorArgumentType;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import java.awt.*; import java.awt.*;
@@ -66,6 +73,12 @@ public class PacketMine extends Module {
false false
)); ));
private final EnumSetting<RotateMode> rotate = sgGeneral.add(new EnumSetting<>(
"rotar",
"rotar al minar bloques mediante el módulo",
RotateMode.class, RotateMode.NONE
));
private final BooleanSetting render = sgRender.add(new BooleanSetting( private final BooleanSetting render = sgRender.add(new BooleanSetting(
"renderizar", "renderizar",
"renderizar un contorno alrededor de los bloques que están siendo minados", "renderizar un contorno alrededor de los bloques que están siendo minados",
@@ -89,7 +102,7 @@ public class PacketMine extends Module {
)); ));
private final BooleanSetting dontBreak = sgGeneral.add(new BooleanSetting( private final BooleanSetting dontBreak = sgGeneral.add(new BooleanSetting(
"no romper", "no romper pico",
"evita romper el pico", "evita romper el pico",
true true
)); ));
@@ -100,8 +113,8 @@ public class PacketMine extends Module {
Category.NETWORK); Category.NETWORK);
render.onUpdate(v -> { render.onUpdate(v -> {
color.setVisible(v); color.visibility(v);
lineWidth.setVisible(v); lineWidth.visibility(v);
}); });
} }
@@ -139,9 +152,7 @@ public class PacketMine extends Module {
if (clickAction.is(ClickAction.ADD_PRIORITY)) { if (clickAction.is(ClickAction.ADD_PRIORITY)) {
miningBlocks.sort(Comparator.comparingInt(block -> -block.clicks)); miningBlocks.sort(Comparator.comparingInt(block -> -block.clicks));
for (MiningBlock block : miningBlocks) { for (MiningBlock block : miningBlocks) {
if (processBlock(block)) { processBlock(block);
break;
}
} }
} else { } else {
if (inOrder.getValue()) { if (inOrder.getValue()) {
@@ -260,12 +271,16 @@ public class PacketMine extends Module {
return false; return false;
} }
if (dontBreak.getValue() && mc.player.getMainHandStack().getMaxDamage() - mc.player.getMainHandStack().getDamage() <= 1) { if (dontBreak.getValue()
&& mc.player.isHolding(ItemStack::isDamageable)
&& mc.player.getMainHandStack().getMaxDamage() - mc.player.getMainHandStack().getDamage() <= 1) {
ChatUtil.warn("pico por romperse"); ChatUtil.warn("pico por romperse");
toggle(); toggle();
return false; return false;
} }
rotate();
mc.interactionManager.sendSequencedPacket(mc.world, sequence -> mc.interactionManager.sendSequencedPacket(mc.world, sequence ->
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, dir, sequence)); new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, dir, sequence));
mining = true; mining = true;
@@ -289,6 +304,15 @@ public class PacketMine extends Module {
); );
} }
private void rotate() {
Vec3d pos = Vec3d.of(this.pos);
switch (rotate.getValue()) {
case CLIENT -> EntityUtil.lookAtClient(pos);
case SERVER -> EntityUtil.lookAtServer(pos);
case BOTH -> EntityUtil.lookAt(pos);
}
}
public boolean shouldRetry() { public boolean shouldRetry() {
return mining && (System.currentTimeMillis() - startTime >= retryTime.getValue()); return mining && (System.currentTimeMillis() - startTime >= retryTime.getValue());
} }
@@ -303,4 +327,15 @@ public class PacketMine extends Module {
ClickAction(String name) { this.name = name; } ClickAction(String name) { this.name = name; }
@Override public String toString() { return name; } @Override public String toString() { return name; }
} }
private enum RotateMode {
CLIENT("cámara"),
SERVER("mediante paquetes"),
BOTH("ambos"),
NONE("no");
private final String name;
RotateMode(String name) { this.name = name; }
@Override public String toString() { return name; }
}
} }
@@ -67,12 +67,12 @@ public class AutoFish extends Module {
public AutoFish() { public AutoFish() {
super("auto pesca", "pesca por ti", Category.PLAYER); super("auto pesca", "pesca por ti", Category.PLAYER);
autoRecast.onUpdate(v -> { autoRecast.onUpdate(v -> {
recastDelay.setVisible(v); recastDelay.visibility(v);
onlyRecastIfLookingAtWater.setVisible(v); onlyRecastIfLookingAtWater.visibility(v);
recastRaycastDistance.setVisible(v); recastRaycastDistance.visibility(v);
}); });
onlyRecastIfLookingAtWater.onUpdate(v -> recastRaycastDistance.setVisible(v)); onlyRecastIfLookingAtWater.onUpdate(v -> recastRaycastDistance.visibility(v));
} }
@Override @Override
@@ -61,8 +61,8 @@ public class FastUse extends Module {
Category.PLAYER, Category.PLAYER,
GLFW.GLFW_KEY_F6); GLFW.GLFW_KEY_F6);
items.onUpdate(v -> itemCooldown.setVisible(v)); items.onUpdate(v -> itemCooldown.visibility(v));
blocks.onUpdate(v -> blockCooldown.setVisible(v)); blocks.onUpdate(v -> blockCooldown.visibility(v));
} }
public int getCooldown(ItemStack stack) { public int getCooldown(ItemStack stack) {
@@ -45,9 +45,9 @@ public class WarnLowDurability extends Module {
Category.PLAYER); Category.PLAYER);
playSound.onUpdate(v -> { playSound.onUpdate(v -> {
sound.setVisible(v); sound.visibility(v);
volume.setVisible(v); volume.visibility(v);
pitch.setVisible(v); pitch.visibility(v);
}); });
} }
@@ -111,12 +111,12 @@ public class BlockESP extends Module {
); );
outlines.onUpdate(v -> { outlines.onUpdate(v -> {
outlineColor.setVisible(v); outlineColor.visibility(v);
lineWidth.setVisible(v); lineWidth.visibility(v);
}); });
fillings.onUpdate(v -> fillings.onUpdate(v ->
fillingColor.setVisible(v) fillingColor.visibility(v)
); );
} }
@@ -71,15 +71,15 @@ public class EntityESP extends Module {
public EntityESP() { public EntityESP() {
super("resaltado de entidades", "resalta el contorno de las entidades seleccionadas a través de bloques", Category.RENDER); super("resaltado de entidades", "resalta el contorno de las entidades seleccionadas a través de bloques", Category.RENDER);
mode.onUpdate(v -> { mode.onUpdate(v -> {
glowColor.setVisible(v == ESPMode.GLOW); glowColor.visibility(v == ESPMode.GLOW);
outlines.setVisible(v == ESPMode.BOX); outlines.visibility(v == ESPMode.BOX);
filling.setVisible(v == ESPMode.BOX); filling.visibility(v == ESPMode.BOX);
outlineColor.setVisible(outlines.isVisible()); outlineColor.visibility(outlines.isVisible());
fillingColor.setVisible(filling.isVisible()); fillingColor.visibility(filling.isVisible());
}); });
outlines.onUpdate(v -> outlineColor.setVisible(v)); outlines.onUpdate(v -> outlineColor.visibility(v));
filling.onUpdate(v -> fillingColor.setVisible(v)); filling.onUpdate(v -> fillingColor.visibility(v));
} }
@EventListener @EventListener
@@ -82,17 +82,17 @@ public class Nametags extends Module {
defaultEntities.replace(EntityType.TNT, true); defaultEntities.replace(EntityType.TNT, true);
entities.setDefaultValue(defaultEntities); entities.setDefaultValue(defaultEntities);
health.onUpdate(v -> healthMode.setVisible(v)); health.onUpdate(v -> healthMode.visibility(v));
entities.onUpdate(entities -> { entities.onUpdate(entities -> {
items.setVisible(entities.get(EntityType.ITEM)); items.visibility(entities.get(EntityType.ITEM));
boolean anyProjectile = entities.get(EntityType.TRIDENT) boolean anyProjectile = entities.get(EntityType.TRIDENT)
|| entities.get(EntityType.ARROW) || entities.get(EntityType.ARROW)
|| entities.get(EntityType.SPECTRAL_ARROW); || entities.get(EntityType.SPECTRAL_ARROW);
showProjectileDamage.setVisible(anyProjectile); showProjectileDamage.visibility(anyProjectile);
tntPrime.setVisible(entities.get(EntityType.TNT)); tntPrime.visibility(entities.get(EntityType.TNT));
}); });
} }
@@ -0,0 +1,119 @@
package me.retucio.sputnik.module.modules.render;
import com.github.retucio.neutrino.EventListener;
import com.ibm.icu.impl.TimeZoneGenericNames;
import me.retucio.sputnik.event.render.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.ListSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.Colors;
import me.retucio.sputnik.util.Lists;
import me.retucio.sputnik.util.render.RenderUtil;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import java.awt.*;
import java.util.Map;
public class Tracers extends Module {
private final SettingGroup sgColors = addSg(new SettingGroup("colores", false));
private final Map<EntityType<?>, Boolean> defaultEntities = Lists.allFalse(Lists.entityList);
private final ListSetting<EntityType<?>> entities = sgGeneral.add(new ListSetting<>(
"entidades",
"entidades a las que apuntar",
Lists.entityList,
defaultEntities,
Lists.entityNames
));
private final NumberSetting lineWidth = sgGeneral.add(new NumberSetting(
"grosor de línea",
"grosor de las líneas",
1.5,
0.1,
10,
0.2
));
private final BooleanSetting self = sgGeneral.add(new BooleanSetting(
"uno mismo",
"apuntarse a uno mismo en cámara libre o así",
true
));
private final ColorSetting playerColor= sgColors.add(new ColorSetting(
"jugadores",
"color para jugadores",
Colors.RED, false
));
private final ColorSetting animalsColor = sgColors.add(new ColorSetting(
"animales",
"color para animales pasivos",
Colors.YELLOW, false
));
private final ColorSetting monstersColor = sgColors.add(new ColorSetting(
"monstruos",
"color para monstruos",
Colors.BROWN, false
));
private final ColorSetting ambientColor = sgColors.add(new ColorSetting(
"ambiente",
"color para entidades ambiente",
Colors.SILVER, false
));
private final ColorSetting waterColor = sgColors.add(new ColorSetting(
"agua",
"color para bichos del agua",
Colors.BLUE, false
));
private final ColorSetting miscColor = sgColors.add(new ColorSetting(
"misc.",
"color para entidades misceláneas",
Colors.BROWN, false
));
public Tracers() {
super("trazos", "trazar líneas de la cámara a las entidades seleccionadas", Category.RENDER);
defaultEntities.replace(EntityType.PLAYER, true);
entities.setDefaultValue(defaultEntities);
}
@EventListener
private void onRenderWorld(Render3DEvent event) {
for (Entity entity : mc.world.getEntities()) {
Color color = getColor(entity);
if (color == null) continue;
Vec3d interpolatedPos = entity.getLerpedPos(event.getTickDelta());
RenderUtil.drawTracer(event.getMatrices(), interpolatedPos, color, lineWidth.getFloatValue());
}
}
private Color getColor(Entity entity) {
if (!entities.isEnabled(entity.getType())) return null;
if (!self.getValue() && mc.player == entity) return null;
if (entity instanceof PlayerEntity) return playerColor.getValue();
return switch (entity.getType().getSpawnGroup()) {
case CREATURE -> animalsColor.getValue().getAlpha() > 0 ? animalsColor.getValue() : null;
case MONSTER -> monstersColor.getValue().getAlpha() > 0 ? monstersColor.getValue() : null;
case AMBIENT, WATER_AMBIENT -> ambientColor.getValue().getAlpha() > 0 ? ambientColor.getValue() : null;
case WATER_CREATURE, UNDERGROUND_WATER_CREATURE -> waterColor.getValue().getAlpha() > 0 ? waterColor.getValue() : null;
case MISC -> miscColor.getValue().getAlpha() > 0 ? miscColor.getValue() : null;
default -> null;
};
}
}
@@ -3,12 +3,12 @@ package me.retucio.sputnik.module.modules.world;
import com.github.retucio.neutrino.EventListener; import com.github.retucio.neutrino.EventListener;
import me.retucio.sputnik.event.input.KeyEvent; import me.retucio.sputnik.event.input.KeyEvent;
import me.retucio.sputnik.event.input.MouseClickEvent; import me.retucio.sputnik.event.input.MouseClickEvent;
import me.retucio.sputnik.mixin.accessors.KeyBindingAccessor;
import me.retucio.sputnik.module.Category; import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.BooleanSetting; import me.retucio.sputnik.module.setting.settings.BooleanSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting; import me.retucio.sputnik.module.setting.settings.NumberSetting;
import me.retucio.sputnik.util.InventoryUtil; import me.retucio.sputnik.util.InventoryUtil;
import me.retucio.sputnik.util.KeyUtil;
import me.retucio.sputnik.util.MiscUtil; import me.retucio.sputnik.util.MiscUtil;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
@@ -59,7 +59,7 @@ public class AutoTool extends Module {
public AutoTool() { public AutoTool() {
super("auto herramienta", "cambia a la herramienta adecuada automáticamente", Category.WORLD); super("auto herramienta", "cambia a la herramienta adecuada automáticamente", Category.WORLD);
switchBack.onUpdate(v -> switchBackDelaySetting.setVisible(v)); switchBack.onUpdate(v -> switchBackDelaySetting.visibility(v));
} }
@Override @Override
@@ -117,7 +117,7 @@ public class AutoTool extends Module {
private void handle(int key, int action) { private void handle(int key, int action) {
if (mc.player == null || mc.player.getInventory() == null) return; if (mc.player == null || mc.player.getInventory() == null) return;
if (key != ((KeyBindingAccessor) mc.options.attackKey).getBoundKey().getCode()) return; if (key != KeyUtil.getKey(mc.options.attackKey)) return;
if (action == GLFW.GLFW_PRESS) { if (action == GLFW.GLFW_PRESS) {
onStartMining(); onStartMining();
@@ -97,7 +97,7 @@ public class LightOverlay extends Module {
"te muestra el nivel de luz en bloques, para prevenir mob spawns", "te muestra el nivel de luz en bloques, para prevenir mob spawns",
Category.WORLD); Category.WORLD);
onWater.onUpdate(v -> dontCullWater.setVisible(v)); onWater.onUpdate(v -> dontCullWater.visibility(v));
} }
@Override @Override
@@ -35,7 +35,7 @@ public class TimeChanger extends Module {
"te deja cambiar visualmente el progreso del día, entre otras cosas", "te deja cambiar visualmente el progreso del día, entre otras cosas",
Category.WORLD); Category.WORLD);
renderMoon.onUpdate(v -> moonPhase.setVisible(v)); renderMoon.onUpdate(v -> moonPhase.visibility(v));
} }
private long realTime; private long realTime;
@@ -4,6 +4,7 @@ import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.sputnik.UpdateSettingEvent; import me.retucio.sputnik.event.sputnik.UpdateSettingEvent;
import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.Module;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer; import java.util.function.Consumer;
// base para los tipos de ajustes // base para los tipos de ajustes
@@ -17,6 +18,7 @@ public abstract class Setting<T> {
protected Consumer<T> updateListener; protected Consumer<T> updateListener;
protected BooleanSupplier visibilityCondition = null;
protected boolean visible = true; protected boolean visible = true;
protected boolean searchMatch = true; protected boolean searchMatch = true;
@@ -30,11 +32,21 @@ public abstract class Setting<T> {
} }
public boolean isVisible() { public boolean isVisible() {
if (visibilityCondition != null) {
return visibilityCondition.getAsBoolean();
}
return visible; return visible;
} }
public void setVisible(boolean visible) { public void visibility(boolean visible) {
this.visible = visible; this.visible = visible;
this.visibilityCondition = null;
}
@SuppressWarnings("unchecked")
public <S extends Setting<T>> S visibility(BooleanSupplier condition) {
this.visibilityCondition = condition;
return (S) this;
} }
public boolean isSearchMatch() { public boolean isSearchMatch() {
@@ -32,9 +32,9 @@ public class ChooseButton<T> extends SettingButton<OptionSetting<T>> {
}; };
// ocultar cosas innecesarias // ocultar cosas innecesarias
dummy.getSettings().get(0).setVisible(false); dummy.getSettings().get(0).visibility(false);
dummy.getSettings().get(1).setVisible(false); dummy.getSettings().get(1).visibility(false);
dummy.getSettings().get(2).setVisible(false); dummy.getSettings().get(2).visibility(false);
dummy.shouldSaveSettings(false); dummy.shouldSaveSettings(false);
} }
@@ -33,9 +33,9 @@ public class ListButton<T> extends SettingButton<ListSetting<T>> {
}; };
// ocultar cosas innecesarias // ocultar cosas innecesarias
dummy.getSettings().get(0).setVisible(false); dummy.getSettings().get(0).visibility(false);
dummy.getSettings().get(1).setVisible(false); dummy.getSettings().get(1).visibility(false);
dummy.getSettings().get(2).setVisible(false); dummy.getSettings().get(2).visibility(false);
dummy.shouldSaveSettings(false); dummy.shouldSaveSettings(false);
} }
@@ -53,7 +53,7 @@ public class ColorPickerFrame extends SettingsFrame {
}; };
// ocultar ajustes innecesarios // ocultar ajustes innecesarios
dummyModule.getSettings().forEach(s -> s.setVisible(false)); dummyModule.getSettings().forEach(s -> s.visibility(false));
dummyModule.shouldSaveSettings(false); dummyModule.shouldSaveSettings(false);
// ajustes de color // ajustes de color
@@ -80,12 +80,12 @@ public class ColorPickerFrame extends SettingsFrame {
setting.onUpdate(v -> updateColorFromSettings()); setting.onUpdate(v -> updateColorFromSettings());
rainbowSetting.onUpdate(v -> { rainbowSetting.onUpdate(v -> {
updateColorFromSettings(); updateColorFromSettings();
redSetting.setVisible(!v); redSetting.visibility(!v);
greenSetting.setVisible(!v); greenSetting.visibility(!v);
blueSetting.setVisible(!v); blueSetting.visibility(!v);
rainbowSpeedSetting.setVisible(v); rainbowSpeedSetting.visibility(v);
saturationSetting.setVisible(v); saturationSetting.visibility(v);
brightnessSetting.setVisible(v); brightnessSetting.visibility(v);
}); });
} }
@@ -2,6 +2,7 @@ package me.retucio.sputnik.util;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.ProjectileUtil; import net.minecraft.entity.projectile.ProjectileUtil;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult; import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Box; import net.minecraft.util.math.Box;
@@ -95,7 +96,26 @@ public class EntityUtil {
return mc.player.getPitch() + MathHelper.wrapDegrees((float) -Math.toDegrees(Math.atan2(diffY, diffXZ)) - mc.player.getPitch()); return mc.player.getPitch() + MathHelper.wrapDegrees((float) -Math.toDegrees(Math.atan2(diffY, diffXZ)) - mc.player.getPitch());
} }
public static enum Target { public static void lookAt(Vec3d pos) {
lookAtClient(pos);
lookAtServer(pos);
}
public static void lookAtClient(Vec3d pos) {
mc.player.setYaw((float) getYaw(pos));
mc.player.setPitch((float) getPitch(pos));
}
public static void lookAtServer(Vec3d pos) {
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
(float) getYaw(pos),
(float) getPitch(pos),
mc.player.isOnGround(),
mc.player.horizontalCollision
));
}
public enum Target {
HEAD, HEAD,
BODY, BODY,
FEET; FEET;
@@ -2,7 +2,6 @@ package me.retucio.sputnik.util;
import me.retucio.sputnik.event.network.DisconnectEvent; import me.retucio.sputnik.event.network.DisconnectEvent;
import me.retucio.sputnik.event.interact.OpenScreenEvent; import me.retucio.sputnik.event.interact.OpenScreenEvent;
import me.retucio.sputnik.mixin.accessors.KeyBindingAccessor;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen; import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.component.ComponentType; import net.minecraft.component.ComponentType;
@@ -325,8 +324,11 @@ public class InventoryUtil {
} }
public static int getSlotNumberFromKey(int key) { public static int getSlotNumberFromKey(int key) {
for (int i = 0; i < 9; i++) for (int i = 0; i < 9; i++) {
if (((KeyBindingAccessor) (mc.options.hotbarKeys[i])).getBoundKey().getCode() == key) return i; if (KeyUtil.getKey(mc.options.hotbarKeys[i]) == key) {
return i;
}
}
return -1; return -1;
} }
@@ -5,7 +5,6 @@ import net.minecraft.client.input.KeyInput;
import net.minecraft.client.option.KeyBinding; import net.minecraft.client.option.KeyBinding;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import java.util.List;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.im.InputContext; import java.awt.im.InputContext;
@@ -20,24 +19,24 @@ public class KeyUtil {
return GLFW.glfwGetKey(mc.getWindow().getHandle(), key); return GLFW.glfwGetKey(mc.getWindow().getHandle(), key);
} }
public static boolean isKeyDown(KeyBinding key) {
return isKeyDown(getKey(key));
}
public static boolean isKeyDown(int key) { public static boolean isKeyDown(int key) {
return GLFW.glfwGetKey( return GLFW.glfwGetKey(
mc.getWindow().getHandle(), mc.getWindow().getHandle(),
key) != GLFW.GLFW_RELEASE; key) != GLFW.GLFW_RELEASE;
} }
public static boolean isKeyDown(KeyBinding key) {
return GLFW.glfwGetKey(
mc.getWindow().getHandle(),
((KeyBindingAccessor) key).getBoundKey().getCode()
) != GLFW.GLFW_RELEASE;
}
public static boolean isShiftDown() { public static boolean isShiftDown() {
return isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT) return isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)
|| isKeyDown(GLFW.GLFW_KEY_RIGHT_SHIFT); || isKeyDown(GLFW.GLFW_KEY_RIGHT_SHIFT);
} }
public static int getKey(KeyBinding kb) {
return ((KeyBindingAccessor) kb).getBoundKey().getCode();
}
public static boolean isCapsLockOn() throws HeadlessException { public static boolean isCapsLockOn() throws HeadlessException {
return Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); return Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
@@ -14,69 +14,34 @@ import java.awt.*;
public class RenderUtil { public class RenderUtil {
private static final MinecraftClient mc = MinecraftClient.getInstance(); private static final MinecraftClient mc = MinecraftClient.getInstance();
private static final Tessellator tesselator = Tessellator.getInstance(); private static final Tessellator tessellator = Tessellator.getInstance();
// líneas /* líneas */
public static void drawLine(MatrixStack matrices, Vec3d start, Vec3d end, Color color, float lineWidth) { // https://github.com/TheF1xer/GateClient-1.12.2/blob/main/src/main/java/me/thef1xer/gateclient/util/RenderUtil.java
Camera camera = mc.gameRenderer.getCamera(); public static void drawTracer(MatrixStack matrices, Vec3d pos, Color color, float lineWidth) {
Vec3d cameraPos = camera.getCameraPos(); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH);
Camera cam = mc.gameRenderer.getCamera();
float startX = (float) (start.x - cameraPos.x); Vector3f cameraVector = new Vector3f(0, 0, 1)
float startY = (float) (start.y - cameraPos.y); .rotateX((float) Math.toRadians(cam.getPitch()))
float startZ = (float) (start.z - cameraPos.z); .rotateY((float) -Math.toRadians(cam.getYaw()));
float endX = (float) (end.x - cameraPos.x);
float endY = (float) (end.y - cameraPos.y);
float endZ = (float) (end.z - cameraPos.z);
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH);
float nx = -1.0f, ny = -1f, nz = -1.0f;
buffer.vertex(matrices.peek().getPositionMatrix(), startX, startY, startZ)
.color(color.getRGB())
.normal(nx, ny, nz)
.lineWidth(lineWidth);
buffer.vertex(matrices.peek().getPositionMatrix(), endX, endY, endZ)
.color(color.getRGB())
.normal(nx, ny, nz)
.lineWidth(lineWidth);
Layers.lines().draw(buffer.end());
}
public static void drawLine2D(MatrixStack matrices, float x1, float y1, float x2, float y2, Color color, float lineWidth) {
float r = color.getRed() / 255f;
float g = color.getGreen() / 255f;
float b = color.getBlue() / 255f;
float a = color.getAlpha() / 255f;
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH);
float nx = 0, ny = 0, nz = 1; // normals not used
buffer.vertex(matrices.peek().getPositionMatrix(), x1, y1, 0)
.color(r, g, b, a)
.normal(nx, ny, nz)
.lineWidth(lineWidth);
buffer.vertex(matrices.peek().getPositionMatrix(), x2, y2, 0)
.color(r, g, b, a)
.normal(nx, ny, nz)
.lineWidth(lineWidth);
buffer.vertex(matrices.peek(), cameraVector.x, cameraVector.y, cameraVector.z).color(color.getRGB()).normal(-1, -1, -1).lineWidth(lineWidth);
buffer.vertex(matrices.peek(), (float) (pos.x - cam.getCameraPos().x), (float) (pos.y - cam.getCameraPos().y), (float) (pos.z - cam.getCameraPos().z)).color(color.getRGB()).normal(-1, -1, -1).lineWidth(lineWidth);
Layers.lines().draw(buffer.end()); Layers.lines().draw(buffer.end());
} }
public static void drawVector(MatrixStack matrices, Vector3f start, Vec3d direction, Color c, float lineWidth) { public static void drawVector(MatrixStack matrices, Vector3f start, Vec3d direction, Color c, float lineWidth) {
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH);
MatrixStack.Entry pose = matrices.peek(); MatrixStack.Entry pose = matrices.peek();
int color = c.getRGB(); int color = c.getRGB();
float a = ((color >> 24) & 0xFF) / 255f;
float r = ((color >> 16) & 0xFF) / 255f; float r = ((color >> 16) & 0xFF) / 255f;
float g = ((color >> 8) & 0xFF) / 255f; float g = ((color >> 8) & 0xFF) / 255f;
float b = (color & 0xFF) / 255f; float b = ((color >> 0) & 0xFF) / 255f;
float a = ((color >> 24) & 0xFF) / 255f;
float endX = start.x() + (float) direction.x; float endX = start.x() + (float) direction.x;
float endY = start.y() + (float) direction.y; float endY = start.y() + (float) direction.y;
@@ -107,7 +72,7 @@ public class RenderUtil {
matrices.push(); matrices.push();
matrices.translate(0, 0, 0); matrices.translate(0, 0, 0);
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
buffer.vertex(matrices.peek().getPositionMatrix(), x, y + height, 0).color(r, g, b, a); buffer.vertex(matrices.peek().getPositionMatrix(), x, y + height, 0).color(r, g, b, a);
buffer.vertex(matrices.peek().getPositionMatrix(), x + width, y + height, 0).color(r, g, b, a); buffer.vertex(matrices.peek().getPositionMatrix(), x + width, y + height, 0).color(r, g, b, a);
@@ -128,7 +93,7 @@ public class RenderUtil {
float maxY = minY + 1; float maxY = minY + 1;
float maxZ = minZ + 1; float maxZ = minZ + 1;
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH);
switch (face) { switch (face) {
case UP: case UP:
@@ -253,7 +218,7 @@ public class RenderUtil {
} }
} }
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
switch (face) { switch (face) {
case DOWN: case DOWN:
@@ -310,7 +275,7 @@ public class RenderUtil {
float b = color.getBlue() / 255f; float b = color.getBlue() / 255f;
float a = color.getAlpha() / 255f; float a = color.getAlpha() / 255f;
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR);
buffer.vertex(matrices.peek().getPositionMatrix(), x1, y1, 0).color(r, g, b, a); buffer.vertex(matrices.peek().getPositionMatrix(), x1, y1, 0).color(r, g, b, a);
buffer.vertex(matrices.peek().getPositionMatrix(), x2, y2, 0).color(r, g, b, a); buffer.vertex(matrices.peek().getPositionMatrix(), x2, y2, 0).color(r, g, b, a);
buffer.vertex(matrices.peek().getPositionMatrix(), x3, y3, 0).color(r, g, b, a); buffer.vertex(matrices.peek().getPositionMatrix(), x3, y3, 0).color(r, g, b, a);
@@ -329,7 +294,7 @@ public class RenderUtil {
float maxY = (float) (box.maxY - cameraPos.y); float maxY = (float) (box.maxY - cameraPos.y);
float maxZ = (float) (box.maxZ - cameraPos.z); float maxZ = (float) (box.maxZ - cameraPos.z);
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR_NORMAL_LINE_WIDTH);
// parte inferior // parte inferior
buffer.vertex(matrices.peek(), minX, minY, minZ).color(color.getRGB()).normal(-1, -1, -1).lineWidth(lineWidth); buffer.vertex(matrices.peek(), minX, minY, minZ).color(color.getRGB()).normal(-1, -1, -1).lineWidth(lineWidth);
@@ -384,7 +349,7 @@ public class RenderUtil {
float maxY = (float) (box.maxY - cameraPos.y); float maxY = (float) (box.maxY - cameraPos.y);
float maxZ = (float) (box.maxZ - cameraPos.z); float maxZ = (float) (box.maxZ - cameraPos.z);
BufferBuilder buffer = tesselator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(color.getRGB()); buffer.vertex(matrices.peek().getPositionMatrix(), minX, minY, minZ).color(color.getRGB());
buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(color.getRGB()); buffer.vertex(matrices.peek().getPositionMatrix(), maxX, minY, minZ).color(color.getRGB());