Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86594f1ca3 | ||
|
|
f074f05c51 | ||
|
|
436b79fd2b | ||
|
|
9afaa4e0c8 | ||
|
|
f794457538 |
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
# jenny's mod 2 100% real
|
# jenny's mod 2 100% real
|
||||||
|
|
||||||
mod para Minecraft Fabric 1.21.10 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
|
mod para Minecraft Fabric 1.21.11 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
|
||||||
|
|
||||||
## instalación
|
## instalación
|
||||||
|
|
||||||
|
|||||||
+13
-23
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version "${loom_version}"
|
id 'fabric-loom' version "${loom_version}"
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
version = project.mod_version
|
version = project.mod_version
|
||||||
@@ -11,21 +11,21 @@ base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Add repositories to retrieve artifacts from in here.
|
maven {
|
||||||
// You should only use this when depending on other mods because
|
name = "FDD Maven"
|
||||||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
|
url = "https://maven.firstdark.dev/releases"
|
||||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
}
|
||||||
// for more information about repositories.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// To change the versions see the gradle.properties file
|
// mc
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
||||||
|
|
||||||
|
// otros
|
||||||
|
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
@@ -45,11 +45,6 @@ tasks.withType(JavaCompile).configureEach {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
||||||
// if it is present.
|
|
||||||
// If you remove this line, sources will not be generated.
|
|
||||||
withSourcesJar()
|
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_21
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
targetCompatibility = JavaVersion.VERSION_21
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
}
|
}
|
||||||
@@ -58,11 +53,12 @@ jar {
|
|||||||
inputs.property "archivesName", project.base.archivesName
|
inputs.property "archivesName", project.base.archivesName
|
||||||
|
|
||||||
from("LICENSE") {
|
from("LICENSE") {
|
||||||
rename { "${it}_${inputs.properties.archivesName}"}
|
rename {
|
||||||
|
"${it}_${inputs.properties.archivesName}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// configure the maven publication
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create("mavenJava", MavenPublication) {
|
create("mavenJava", MavenPublication) {
|
||||||
@@ -71,11 +67,5 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
repositories {}
|
||||||
repositories {
|
|
||||||
// Add repositories to publish to here.
|
|
||||||
// Notice: This block does NOT have the same function as the block in the top level.
|
|
||||||
// The repositories here will be used for publishing your artifact, not for
|
|
||||||
// retrieving dependencies.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+15
-4
@@ -1,18 +1,29 @@
|
|||||||
# v2.4
|
# v2.9
|
||||||
|
|
||||||
## novedades
|
## novedades
|
||||||
|
|
||||||
ahora se usa el formato binario (.dat) en vez de .json para guardar ajustes, lo que los hace más rápidos, y el archivo más liviano
|
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
|
### adiciones
|
||||||
|
|
||||||
|
- categoría de movimiento
|
||||||
|
|
||||||
#### módulos nuevos:
|
#### módulos nuevos:
|
||||||
|
|
||||||
- capas: cambia (solo visualmente, para ti) la capa que usas a una custom de las disponibles
|
- 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
|
### arreglos / mejoras
|
||||||
|
|
||||||
- renombrado bien todo que lo hice con prisa
|
- ahora puedes cambiar el título de la ventana en los ajustes del mod
|
||||||
|
|
||||||
## problemas reconocidos
|
## problemas reconocidos
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT
|
|||||||
|
|
||||||
fabric_api_version=0.140.2+1.21.11
|
fabric_api_version=0.140.2+1.21.11
|
||||||
|
|
||||||
mod_version=2.4
|
mod_version=2.9
|
||||||
maven_group=me.retucio
|
maven_group=me.retucio
|
||||||
archives_base_name=sputnik
|
archives_base_name=sputnik
|
||||||
@@ -19,6 +19,7 @@ import me.retucio.sputnik.module.Module;
|
|||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.client.HUD;
|
import me.retucio.sputnik.module.modules.client.HUD;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.ui.hud.HudRenderer;
|
||||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||||
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
||||||
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
|
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
|
||||||
@@ -29,9 +30,11 @@ import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
|||||||
import me.retucio.sputnik.ui.widgets.Button;
|
import me.retucio.sputnik.ui.widgets.Button;
|
||||||
|
|
||||||
import me.retucio.sputnik.util.*;
|
import me.retucio.sputnik.util.*;
|
||||||
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import me.retucio.sputnik.util.render.DrawUtil;
|
import me.retucio.sputnik.util.render.DrawUtil;
|
||||||
import me.retucio.sputnik.util.render.RenderUtil;
|
import me.retucio.sputnik.util.render.RenderUtil;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.util.render.Textures;
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
|
||||||
@@ -69,6 +72,11 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
private Screen prevScreen;
|
private Screen prevScreen;
|
||||||
public static boolean settingsApplied = false;
|
public static boolean settingsApplied = false;
|
||||||
|
|
||||||
|
static {
|
||||||
|
// puta vida
|
||||||
|
System.setProperty("java.awt.headless", "false");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
mc = MinecraftClient.getInstance();
|
mc = MinecraftClient.getInstance();
|
||||||
@@ -86,6 +94,8 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
|
|
||||||
Lists.init();
|
Lists.init();
|
||||||
|
|
||||||
|
Textures.registerAll();
|
||||||
|
|
||||||
CapeManager.INSTANCE = new CapeManager();
|
CapeManager.INSTANCE = new CapeManager();
|
||||||
EVENT_BUS.post(new LoadCapeManagerEvent());
|
EVENT_BUS.post(new LoadCapeManagerEvent());
|
||||||
|
|
||||||
@@ -99,6 +109,8 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
HudEditorScreen.INSTANCE = new HudEditorScreen();
|
HudEditorScreen.INSTANCE = new HudEditorScreen();
|
||||||
EVENT_BUS.post(new LoadClickGUIEvent());
|
EVENT_BUS.post(new LoadClickGUIEvent());
|
||||||
|
|
||||||
|
mc.execute(HudRenderer::init);
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
EVENT_BUS.post(new ShutdownEvent());
|
EVENT_BUS.post(new ShutdownEvent());
|
||||||
}));
|
}));
|
||||||
@@ -114,13 +126,13 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
|
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
|
||||||
|
mc.getWindow().setTitle(ClientSettingsFrame.guiSettings.windowTitle.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// se ejecuta cada vez que se presiona una tecla
|
// se ejecuta cada vez que se presiona una tecla
|
||||||
public void onKey(int key, int action) {
|
public void onKey(int key, int action) {
|
||||||
if (key == GLFW.GLFW_KEY_F3) return; // prevenir activación de módulos al usar combinaciones de F3
|
if (key == GLFW.GLFW_KEY_F3) return; // prevenir activación de módulos al usar combinaciones de F3
|
||||||
ModuleManager.INSTANCE.getEnabledModules().forEach(module -> module.onKey(key, action));
|
|
||||||
|
|
||||||
boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused();
|
boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused();
|
||||||
ClickGUI.INSTANCE.setAnyFocused(anyFocused);
|
ClickGUI.INSTANCE.setAnyFocused(anyFocused);
|
||||||
@@ -190,7 +202,7 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
// manejar la lógica de apertura del editor de elementos del hud, con la misma lógica que handleClickGUIKey()
|
// manejar la lógica de apertura del editor de elementos del hud, con la misma lógica que handleClickGUIKey()
|
||||||
private void handleHudEditorKey(int key, boolean anyFocused) {
|
private void handleHudEditorKey(int key, boolean anyFocused) {
|
||||||
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
|
||||||
if (key != hud.editorKey.getKey() || anyFocused || isOnTypingScreen()) return;
|
if (key != hud.editorKey.getValue() || anyFocused || isOnTypingScreen()) return;
|
||||||
|
|
||||||
if (mc.currentScreen != HudEditorScreen.INSTANCE) {
|
if (mc.currentScreen != HudEditorScreen.INSTANCE) {
|
||||||
if (!hud.isEnabled()) {
|
if (!hud.isEnabled()) {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class CommandManager {
|
|||||||
|
|
||||||
public static void registerCommands() {
|
public static void registerCommands() {
|
||||||
addCommand(new BindCommand());
|
addCommand(new BindCommand());
|
||||||
|
addCommand(new ConfigCommand());
|
||||||
addCommand(new CopyScreenshotCommand());
|
addCommand(new CopyScreenshotCommand());
|
||||||
addCommand(new EnderChestCommand());
|
addCommand(new EnderChestCommand());
|
||||||
addCommand(new GarbageCleanerCommand());
|
addCommand(new GarbageCleanerCommand());
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.mojang.brigadier.suggestion.Suggestions;
|
|||||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
|
import me.retucio.sputnik.util.MiscUtil;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
@@ -19,6 +20,7 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
public class ModuleArgumentType implements ArgumentType<Module> {
|
public class ModuleArgumentType implements ArgumentType<Module> {
|
||||||
|
|
||||||
public static final ModuleArgumentType INSTANCE = new ModuleArgumentType();
|
public static final ModuleArgumentType INSTANCE = new ModuleArgumentType();
|
||||||
|
|
||||||
private static final DynamicCommandExceptionType UNKNOWN_MODULE = new DynamicCommandExceptionType(
|
private static final DynamicCommandExceptionType UNKNOWN_MODULE = new DynamicCommandExceptionType(
|
||||||
name -> Text.literal("módulo \"" + name + "\" no encontrado"));
|
name -> Text.literal("módulo \"" + name + "\" no encontrado"));
|
||||||
|
|
||||||
@@ -35,7 +37,8 @@ public class ModuleArgumentType implements ArgumentType<Module> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
|
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
|
||||||
return CommandSource.suggestMatching(ModuleManager.INSTANCE.getModules().stream().map(module -> module.getName().replace(" ", "_")), builder);
|
return CommandSource.suggestMatching(ModuleManager.INSTANCE.getModules()
|
||||||
|
.stream().map(module -> MiscUtil.removeAccentMarks(module.getName().replace(" ", "_"))), builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
|||||||
import me.retucio.sputnik.command.Command;
|
import me.retucio.sputnik.command.Command;
|
||||||
import me.retucio.sputnik.command.args.ModuleArgumentType;
|
import me.retucio.sputnik.command.args.ModuleArgumentType;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import me.retucio.sputnik.util.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
@@ -42,7 +42,7 @@ public class BindCommand extends Command {
|
|||||||
public static boolean onKeyPress(int key) {
|
public static boolean onKeyPress(int key) {
|
||||||
if (listeningModule == null) return false;
|
if (listeningModule == null) return false;
|
||||||
KeySetting bind = listeningModule.getBind();
|
KeySetting bind = listeningModule.getBind();
|
||||||
if (bind != null) bind.setKey(key);
|
if (bind != null) bind.setValue(key);
|
||||||
|
|
||||||
ChatUtil.info(
|
ChatUtil.info(
|
||||||
Text.of("la tecla " + Formatting.AQUA + KeyUtil.getKeyName(key) + Formatting.RESET +
|
Text.of("la tecla " + Formatting.AQUA + KeyUtil.getKeyName(key) + Formatting.RESET +
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package me.retucio.sputnik.command.commands;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||||
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
|
import com.mojang.brigadier.context.CommandContext;
|
||||||
|
import me.retucio.sputnik.command.Command;
|
||||||
|
import me.retucio.sputnik.command.args.ModuleArgumentType;
|
||||||
|
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||||
|
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||||
|
import net.minecraft.command.CommandSource;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
|
||||||
|
public class ConfigCommand extends Command {
|
||||||
|
|
||||||
|
public ConfigCommand() {
|
||||||
|
super("config", "abre el marco de ajustes de un módulo", "ajustes", "settings");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||||
|
builder
|
||||||
|
.then(argument("módulo", ModuleArgumentType.INSTANCE)
|
||||||
|
.executes(ctx -> {
|
||||||
|
mc.execute(() -> openSf(ctx));
|
||||||
|
return SUCCESS;
|
||||||
|
})
|
||||||
|
.then(argument("x", IntegerArgumentType.integer())
|
||||||
|
.then(argument("y", IntegerArgumentType.integer())
|
||||||
|
.executes(ctx -> {
|
||||||
|
mc.execute(() -> openSfWithPos(ctx,
|
||||||
|
ctx.getArgument("x", Integer.class),
|
||||||
|
ctx.getArgument("y", Integer.class)));
|
||||||
|
return SUCCESS;
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void openSf(CommandContext<CommandSource> ctx) {
|
||||||
|
Module module = ctx.getArgument("módulo", Module.class);
|
||||||
|
mc.setScreen(ClickGUI.INSTANCE);
|
||||||
|
|
||||||
|
if (ClickGUI.INSTANCE.isSettingsFrameOpen(module)) return;
|
||||||
|
|
||||||
|
SettingsFrame sf = ClickGUI.INSTANCE.getSfOfModule(module);
|
||||||
|
int x = mc.getWindow().getScaledWidth() / 2 - sf.getW() / 2;
|
||||||
|
int y = 67;
|
||||||
|
|
||||||
|
ClickGUI.INSTANCE.openSettingsFrame(module, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openSfWithPos(CommandContext<CommandSource> ctx, int x, int y) {
|
||||||
|
Module module = ctx.getArgument("módulo", Module.class);
|
||||||
|
mc.setScreen(ClickGUI.INSTANCE);
|
||||||
|
|
||||||
|
if (ClickGUI.INSTANCE.isSettingsFrameOpen(module)) {
|
||||||
|
SettingsFrame sf = ClickGUI.INSTANCE.getSfOfModule(module);
|
||||||
|
sf.setX(x);
|
||||||
|
sf.setY(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
ClickGUI.INSTANCE.openSettingsFrame(module, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package me.retucio.sputnik.config;
|
|||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.*;
|
import me.retucio.sputnik.event.events.sputnik.*;
|
||||||
import me.retucio.sputnik.module.settings.*;
|
import me.retucio.sputnik.module.setting.settings.*;
|
||||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@@ -57,9 +57,9 @@ public class ClientConfig {
|
|||||||
// guardar ajustes con su respectivo tipo de valor, en formato "nombreMódulo:nombreAjuste"
|
// guardar ajustes con su respectivo tipo de valor, en formato "nombreMódulo:nombreAjuste"
|
||||||
Object value = null;
|
Object value = null;
|
||||||
switch (event.getSetting()) {
|
switch (event.getSetting()) {
|
||||||
case BooleanSetting b: value = b.isEnabled(); break;
|
case BooleanSetting b: value = b.getValue(); break;
|
||||||
case EnumSetting e: value = e.getIndex(); break;
|
case EnumSetting e: value = e.getIndex(); break;
|
||||||
case KeySetting k: value = k.getKey(); break;
|
case KeySetting k: value = k.getValue(); break;
|
||||||
case NumberSetting n: value = n.getValue(); break;
|
case NumberSetting n: value = n.getValue(); break;
|
||||||
case StringSetting s: value = s.getValue(); break;
|
case StringSetting s: value = s.getValue(); break;
|
||||||
case ListSetting l: value = l.getConfigValues(); break;
|
case ListSetting l: value = l.getConfigValues(); break;
|
||||||
@@ -78,13 +78,13 @@ public class ClientConfig {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
|
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
|
||||||
settingsFrames.remove(event.getFrame().module.getName());
|
settingsFrames.remove(event.getFrame().getModule().getName());
|
||||||
ConfigManager.save();
|
ConfigManager.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
|
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
|
||||||
settingsFrames.replace(event.getFrame().module.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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,20 +5,20 @@ import com.google.gson.GsonBuilder;
|
|||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.settings.*;
|
import me.retucio.sputnik.module.setting.*;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.*;
|
||||||
import me.retucio.sputnik.ui.widgets.Frame;
|
import me.retucio.sputnik.ui.widgets.Frame;
|
||||||
import me.retucio.sputnik.ui.widgets.frames.ModuleFrame;
|
import me.retucio.sputnik.ui.widgets.frames.ModuleFrame;
|
||||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||||
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||||
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
// se ocupa de guardar, cargar y aplicar ajustes
|
// se ocupa de guardar, cargar y aplicar ajustes
|
||||||
public class ConfigManager {
|
public class ConfigManager {
|
||||||
@@ -107,7 +107,7 @@ public class ConfigManager {
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setSetting(Setting setting, Object value) {
|
public static void setSetting(Setting<?> setting, Object value) {
|
||||||
ensureConfig();
|
ensureConfig();
|
||||||
config.settings.put(getSettingKey(setting), value);
|
config.settings.put(getSettingKey(setting), value);
|
||||||
save();
|
save();
|
||||||
@@ -115,10 +115,10 @@ public class ConfigManager {
|
|||||||
|
|
||||||
public static void setFramePosition(SettingsFrame frame) {
|
public static void setFramePosition(SettingsFrame frame) {
|
||||||
ensureConfig();
|
ensureConfig();
|
||||||
if (!config.settingsFrames.containsKey(frame.module.getName()))
|
if (!config.settingsFrames.containsKey(frame.getModule().getName()))
|
||||||
config.settingsFrames.put(frame.module.getName(), new int[] {frame.getX(), frame.getY()});
|
config.settingsFrames.put(frame.getModule().getName(), new int[] {frame.getX(), frame.getY()});
|
||||||
else
|
else
|
||||||
config.settingsFrames.replace(frame.module.getName(), new int[] {frame.getX(), frame.getY()});
|
config.settingsFrames.replace(frame.getModule().getName(), new int[] {frame.getX(), frame.getY()});
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,17 +140,6 @@ public class ConfigManager {
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setHudImagePath(String id, String imagePath) {
|
|
||||||
ensureConfig();
|
|
||||||
config.hudImagePaths.put(id, imagePath);
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getHudImagePath(String id) {
|
|
||||||
ensureConfig();
|
|
||||||
return config.hudImagePaths.getOrDefault(id, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setSearchBarPosition(int x, int y) {
|
public static void setSearchBarPosition(int x, int y) {
|
||||||
ensureConfig();
|
ensureConfig();
|
||||||
config.searchBarPosition = new int[] {x, y};
|
config.searchBarPosition = new int[] {x, y};
|
||||||
@@ -161,7 +150,7 @@ public class ConfigManager {
|
|||||||
// ------------------ APLICAR AJUSTES ------------------
|
// ------------------ APLICAR AJUSTES ------------------
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public static void applySetting(Module parent, Setting setting) {
|
public static void applySetting(Module parent, Setting<?> setting) {
|
||||||
String key = getSettingKey(setting);
|
String key = getSettingKey(setting);
|
||||||
|
|
||||||
if (!config.settings.containsKey(key)) return;
|
if (!config.settings.containsKey(key)) return;
|
||||||
@@ -200,8 +189,15 @@ public class ConfigManager {
|
|||||||
private static void applySettingsFrames() {
|
private static void applySettingsFrames() {
|
||||||
config.settingsFrames.forEach((moduleName, position) -> {
|
config.settingsFrames.forEach((moduleName, position) -> {
|
||||||
Module module = ModuleManager.INSTANCE.getModuleByName(moduleName);
|
Module module = ModuleManager.INSTANCE.getModuleByName(moduleName);
|
||||||
|
|
||||||
|
if (module == null) {
|
||||||
|
Sputnik.LOGGER.warn("\"null\" como módulo (\"{}\")", moduleName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ClickGUI.INSTANCE.openSettingsFrame(module, position[0], position[1]);
|
ClickGUI.INSTANCE.openSettingsFrame(module, position[0], position[1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
Sputnik.LOGGER.info("estados de marcos de ajustes aplicados");
|
Sputnik.LOGGER.info("estados de marcos de ajustes aplicados");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,11 +244,12 @@ public class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ajustes de módulos
|
// ajustes de módulos
|
||||||
|
|
||||||
private static void applyBooleanSetting(BooleanSetting setting, Object value) {
|
private static void applyBooleanSetting(BooleanSetting setting, Object value) {
|
||||||
if (value instanceof Boolean) {
|
if (value instanceof Boolean) {
|
||||||
setting.setEnabled((Boolean) value);
|
setting.setValue((Boolean) value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,9 +275,9 @@ public class ConfigManager {
|
|||||||
|
|
||||||
private static void applyKeySetting(KeySetting setting, Object value) {
|
private static void applyKeySetting(KeySetting setting, Object value) {
|
||||||
if (value instanceof Double) {
|
if (value instanceof Double) {
|
||||||
setting.setKey(((Double) value).intValue());
|
setting.setValue(((Double) value).intValue());
|
||||||
} else if (value instanceof Integer) {
|
} else if (value instanceof Integer) {
|
||||||
setting.setKey((Integer) value);
|
setting.setValue((Integer) value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +291,7 @@ public class ConfigManager {
|
|||||||
convertedValues.put(option, booleanValue instanceof Boolean && (Boolean) booleanValue);
|
convertedValues.put(option, booleanValue instanceof Boolean && (Boolean) booleanValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
setting.setValues(convertedValues);
|
setting.setValue(convertedValues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,8 +303,14 @@ public class ConfigManager {
|
|||||||
Number b = (Number) map.get("b");
|
Number b = (Number) map.get("b");
|
||||||
Number a = (Number) map.get("a");
|
Number a = (Number) map.get("a");
|
||||||
|
|
||||||
if (r != null && g != null && b != null && a != null)
|
if (r != null && g != null && b != null && a != null) {
|
||||||
setting.setRGB(r.intValue(), g.intValue(), b.intValue(), a.intValue());
|
setting.setRGB(
|
||||||
|
r.intValue(),
|
||||||
|
g.intValue(),
|
||||||
|
b.intValue(),
|
||||||
|
a.intValue()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
applyOptionalProperty(map, "rb", Boolean.class, setting::setRainbow);
|
applyOptionalProperty(map, "rb", Boolean.class, setting::setRainbow);
|
||||||
applyOptionalProperty(map, "rs", Number.class, val -> setting.setRainbowSpeed(val.intValue()));
|
applyOptionalProperty(map, "rs", Number.class, val -> setting.setRainbowSpeed(val.intValue()));
|
||||||
@@ -321,7 +324,7 @@ public class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T> void applyOptionalProperty(Map<?, ?> map, String key, Class<T> type, java.util.function.Consumer<T> setter) {
|
private static <T> void applyOptionalProperty(Map<?, ?> map, String key, Class<T> type, Consumer<T> setter) {
|
||||||
Object value = map.get(key);
|
Object value = map.get(key);
|
||||||
if (type.isInstance(value)) {
|
if (type.isInstance(value)) {
|
||||||
setter.accept(type.cast(value));
|
setter.accept(type.cast(value));
|
||||||
@@ -339,8 +342,8 @@ public class ConfigManager {
|
|||||||
if (config == null) config = new ClientConfig();
|
if (config == null) config = new ClientConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getSettingKey(Setting setting) {
|
private static String getSettingKey(Setting<?> setting) {
|
||||||
return setting.getModule().getName() + ":" + setting.getName();
|
return setting.getSg().getModule().getName() + ":" + setting.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasLoaded() {
|
public static boolean hasLoaded() {
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package me.retucio.sputnik.event;
|
||||||
|
|
||||||
|
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public class BoatMoveEvent extends Event {
|
||||||
|
|
||||||
|
private final AbstractBoatEntity boat;
|
||||||
|
private Vec3d pos;
|
||||||
|
|
||||||
|
public BoatMoveEvent(AbstractBoatEntity boat, Vec3d pos) {
|
||||||
|
this.boat = boat;
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbstractBoatEntity getBoat() {
|
||||||
|
return boat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vec3d getPos() {
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPos(Vec3d pos) {
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package me.retucio.sputnik.event.events;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.event.Event;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
|
||||||
|
public class AttackBlockEvent extends Event {
|
||||||
|
|
||||||
|
private final BlockPos pos;
|
||||||
|
private final Direction dir;
|
||||||
|
|
||||||
|
public AttackBlockEvent(BlockPos pos, Direction dir) {
|
||||||
|
this.pos = pos;
|
||||||
|
this.dir = dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getPos() {
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Direction getDir() {
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package me.retucio.sputnik.event.events;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.event.Event;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
|
||||||
|
public class BlockShapeEvent extends Event {
|
||||||
|
|
||||||
|
private BlockState state;
|
||||||
|
private BlockPos pos;
|
||||||
|
private VoxelShape shape;
|
||||||
|
|
||||||
|
public BlockShapeEvent(BlockState state, BlockPos pos, VoxelShape shape) {
|
||||||
|
this.state = state;
|
||||||
|
this.pos = pos;
|
||||||
|
this.setShape(shape);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockState getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(BlockState state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getPos() {
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPos(BlockPos pos) {
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VoxelShape getShape() {
|
||||||
|
return shape;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShape(VoxelShape shape) {
|
||||||
|
this.shape = shape;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package me.retucio.sputnik.event.events;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.event.Event;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
|
|
||||||
|
public class Render2DEvent extends Event {
|
||||||
|
|
||||||
|
private final DrawContext ctx;
|
||||||
|
private final RenderTickCounter tc;
|
||||||
|
|
||||||
|
public Render2DEvent(DrawContext ctx, RenderTickCounter tc) {
|
||||||
|
this.ctx = ctx;
|
||||||
|
this.tc = tc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DrawContext getCtx() {
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderTickCounter getTc() {
|
||||||
|
return tc;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -9,13 +9,13 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||||||
/**
|
/**
|
||||||
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render
|
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render
|
||||||
*/
|
*/
|
||||||
public class RenderWorldEvent extends Event {
|
public class Render3DEvent extends Event {
|
||||||
|
|
||||||
private final MatrixStack matrices;
|
private final MatrixStack matrices;
|
||||||
private final RenderTickCounter tc;
|
private final RenderTickCounter tc;
|
||||||
private final Camera camera;
|
private final Camera camera;
|
||||||
|
|
||||||
public RenderWorldEvent(MatrixStack matrices, RenderTickCounter tc, Camera camera) {
|
public Render3DEvent(MatrixStack matrices, RenderTickCounter tc, Camera camera) {
|
||||||
this.matrices = matrices;
|
this.matrices = matrices;
|
||||||
this.tc = tc;
|
this.tc = tc;
|
||||||
this.camera = camera;
|
this.camera = camera;
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
package me.retucio.sputnik.event.events.sputnik;
|
package me.retucio.sputnik.event.events.sputnik;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.Event;
|
import me.retucio.sputnik.event.Event;
|
||||||
import me.retucio.sputnik.module.settings.Setting;
|
import me.retucio.sputnik.module.setting.Setting;
|
||||||
|
|
||||||
// se genera cada que se cambia el valor de un ajuste
|
// se genera cada que se cambia el valor de un ajuste
|
||||||
public class UpdateSettingEvent extends Event {
|
public class UpdateSettingEvent extends Event {
|
||||||
|
|
||||||
private final Setting setting;
|
private final Setting<?> setting;
|
||||||
private boolean shouldSave;
|
private boolean shouldSave;
|
||||||
|
|
||||||
public UpdateSettingEvent(Setting setting, boolean shouldSave) {
|
public UpdateSettingEvent(Setting<?> setting, boolean shouldSave) {
|
||||||
this.setting = setting;
|
this.setting = setting;
|
||||||
this.shouldSave = shouldSave;
|
this.shouldSave = shouldSave;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Setting getSetting() {
|
public Setting<?> getSetting() {
|
||||||
return setting;
|
return setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package me.retucio.sputnik.mixin;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.Sputnik;
|
||||||
|
import me.retucio.sputnik.event.BoatMoveEvent;
|
||||||
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
|
import me.retucio.sputnik.module.modules.movement.BoatFly;
|
||||||
|
import net.minecraft.entity.MovementType;
|
||||||
|
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(AbstractBoatEntity.class)
|
||||||
|
public abstract class AbstractBoatEntityMixin {
|
||||||
|
|
||||||
|
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/AbstractBoatEntity;move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V"))
|
||||||
|
private void onMove(AbstractBoatEntity instance, MovementType movementType, Vec3d vec3d) {
|
||||||
|
BoatMoveEvent event = Sputnik.EVENT_BUS.post(new BoatMoveEvent(instance, vec3d));
|
||||||
|
if(!event.isCancelled()) instance.move(movementType, event.getPos());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "updatePaddles", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onPaddle(CallbackInfo ci) {
|
||||||
|
if (ModuleManager.INSTANCE.getModuleByClass(BoatFly.class).isEnabled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package me.retucio.sputnik.mixin;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||||
|
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||||
|
import me.retucio.sputnik.Sputnik;
|
||||||
|
import me.retucio.sputnik.event.events.BlockShapeEvent;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
|
import net.minecraft.world.BlockCollisionSpliterator;
|
||||||
|
import net.minecraft.world.CollisionView;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
import static me.retucio.sputnik.Sputnik.mc;
|
||||||
|
|
||||||
|
@Mixin(BlockCollisionSpliterator.class)
|
||||||
|
public abstract class BlockCollisionSpliteratorMixin {
|
||||||
|
|
||||||
|
@WrapOperation(method = "computeNext", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/ShapeContext;getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/CollisionView;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/shape/VoxelShape;"))
|
||||||
|
private VoxelShape onGetBlockShape(ShapeContext instance, BlockState state, CollisionView collisionView, BlockPos pos, Operation<VoxelShape> original) {
|
||||||
|
VoxelShape shape = original.call(instance, state, collisionView, pos);
|
||||||
|
|
||||||
|
if (collisionView != mc.world) {
|
||||||
|
return shape;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlockShapeEvent event = Sputnik.EVENT_BUS.post(new BlockShapeEvent(state, pos, shape));
|
||||||
|
return event.isCancelled() ? VoxelShapes.empty() : event.getShape();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,8 @@ import java.util.Iterator;
|
|||||||
|
|
||||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||||
|
|
||||||
@Mixin(BossBarHud.class)
|
|
||||||
|
@Mixin(value = BossBarHud.class)
|
||||||
public abstract class BossBarHudMixin {
|
public abstract class BossBarHudMixin {
|
||||||
|
|
||||||
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/Collection;iterator()Ljava/util/Iterator;"))
|
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/Collection;iterator()Ljava/util/Iterator;"))
|
||||||
@@ -30,7 +31,8 @@ public abstract class BossBarHudMixin {
|
|||||||
return event.getName();
|
return event.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyConstant(method = "render", constant = @Constant(intValue = 9, ordinal = 1))
|
// require = 0 para meteor
|
||||||
|
@ModifyConstant(method = "render", constant = @Constant(intValue = 9, ordinal = 1), require = 0)
|
||||||
public int modifySpacingConstant(int constant) {
|
public int modifySpacingConstant(int constant) {
|
||||||
RenderBossbarEvent.BossSpacing event = EVENT_BUS.post(new RenderBossbarEvent.BossSpacing(constant));
|
RenderBossbarEvent.BossSpacing event = EVENT_BUS.post(new RenderBossbarEvent.BossSpacing(constant));
|
||||||
return event.getSpacing();
|
return event.getSpacing();
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public abstract class CameraMixin {
|
|||||||
|
|
||||||
@Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true)
|
||||||
private void onClipToSpace(float distance, CallbackInfoReturnable<Float> cir) {
|
private void onClipToSpace(float distance, CallbackInfoReturnable<Float> cir) {
|
||||||
if (perspectivePlus.isEnabled() && perspectivePlus.clip.isEnabled())
|
if (perspectivePlus.isEnabled() && perspectivePlus.clip.getValue())
|
||||||
cir.setReturnValue(distance);
|
cir.setReturnValue(distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public abstract class ChatHudMixin implements IChatHud {
|
|||||||
|
|
||||||
@ModifyExpressionValue(method = "render(Lnet/minecraft/client/gui/hud/ChatHud$Backend;IIZ)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;ceil(F)I"))
|
@ModifyExpressionValue(method = "render(Lnet/minecraft/client/gui/hud/ChatHud$Backend;IIZ)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;ceil(F)I"))
|
||||||
private int onRender_modifyWidth(int width) {
|
private int onRender_modifyWidth(int width) {
|
||||||
return (chatPlus.isEnabled() && chatPlus.showHeads.isEnabled()) ? width + 10 : width;
|
return (chatPlus.isEnabled() && chatPlus.showHeads.getValue()) ? width + 10 : width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ public abstract class ChatScreenMixin {
|
|||||||
@Inject(method = "init", at = @At(value = "RETURN"))
|
@Inject(method = "init", at = @At(value = "RETURN"))
|
||||||
private void onInit(CallbackInfo info) {
|
private void onInit(CallbackInfo info) {
|
||||||
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
||||||
if (chatPlus.isEnabled() && chatPlus.noCharLimit.isEnabled()) chatField.setMaxLength(Integer.MAX_VALUE);
|
if (chatPlus.isEnabled() && chatPlus.noCharLimit.getValue()) chatField.setMaxLength(Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ public abstract class ClientPlayNetworkHandlerMixin {
|
|||||||
@Redirect(method = "onEntityStatus", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;showFloatingItem(Lnet/minecraft/item/ItemStack;)V"))
|
@Redirect(method = "onEntityStatus", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;showFloatingItem(Lnet/minecraft/item/ItemStack;)V"))
|
||||||
private void noRenderTotemPop(GameRenderer instance, ItemStack floatingItem) {
|
private void noRenderTotemPop(GameRenderer instance, ItemStack floatingItem) {
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
if (!noRender.isEnabled() || noRender.totemPop.isEnabled())
|
if (!noRender.isEnabled() || noRender.totemPop.getValue())
|
||||||
mc.gameRenderer.showFloatingItem(floatingItem);
|
mc.gameRenderer.showFloatingItem(floatingItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package me.retucio.sputnik.mixin;
|
package me.retucio.sputnik.mixin;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.events.AttackEntityEvent;
|
import me.retucio.sputnik.event.events.*;
|
||||||
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.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
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.MinecraftClient;
|
||||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||||
import net.minecraft.client.network.ClientPlayerEntity;
|
import net.minecraft.client.network.ClientPlayerEntity;
|
||||||
@@ -16,7 +15,8 @@ import net.minecraft.util.ActionResult;
|
|||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import net.minecraft.util.math.Direction;
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
@@ -28,21 +28,25 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||||
import static me.retucio.sputnik.Sputnik.mc;
|
import static me.retucio.sputnik.Sputnik.mc;
|
||||||
|
|
||||||
|
|
||||||
@Mixin(ClientPlayerInteractionManager.class)
|
@Mixin(ClientPlayerInteractionManager.class)
|
||||||
public abstract class ClientPlayerInteractionManagerMixin {
|
public abstract class ClientPlayerInteractionManagerMixin {
|
||||||
|
|
||||||
@Shadow @Final
|
@Shadow
|
||||||
private MinecraftClient client;
|
private int blockBreakingCooldown;
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
Freecam freecam;
|
Freecam freecam;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
FastUse fastUse;
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void getModules(MinecraftClient client, ClientPlayNetworkHandler networkHandler, CallbackInfo ci) {
|
private void getModules(MinecraftClient client, ClientPlayNetworkHandler networkHandler, CallbackInfo ci) {
|
||||||
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
|
fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Inject(method = "breakBlock", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "breakBlock", at = @At("HEAD"), cancellable = true)
|
||||||
private void onBlockBreak(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
private void onBlockBreak(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||||
BreakBlockEvent event = EVENT_BUS.post(new BreakBlockEvent(pos));
|
BreakBlockEvent event = EVENT_BUS.post(new BreakBlockEvent(pos));
|
||||||
@@ -56,6 +60,12 @@ public abstract class ClientPlayerInteractionManagerMixin {
|
|||||||
if (event.isCancelled()) cir.cancel();
|
if (event.isCancelled()) cir.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "attackBlock", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onAttackBlock(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
AttackBlockEvent event = EVENT_BUS.post(new AttackBlockEvent(pos, direction));
|
||||||
|
if (event.isCancelled()) cir.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
@Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
|
||||||
private void onEntityInteract(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
private void onEntityInteract(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||||
if (mc.player != player) return;
|
if (mc.player != player) return;
|
||||||
@@ -69,4 +79,11 @@ public abstract class ClientPlayerInteractionManagerMixin {
|
|||||||
AttackEntityEvent event = EVENT_BUS.post(new AttackEntityEvent(target));
|
AttackEntityEvent event = EVENT_BUS.post(new AttackEntityEvent(target));
|
||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"))
|
||||||
|
private void modifyBlockBreakingCooldown(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if (!fastUse.isEnabled() || !fastUse.mining.getValue()) return;
|
||||||
|
blockBreakingCooldown = fastUse.miningCooldown.getIntValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ abstract class DamageParticleFactoryMixin {
|
|||||||
original.velocityMultiplier *= crits.velocityMultipler.getFloatValue();
|
original.velocityMultiplier *= crits.velocityMultipler.getFloatValue();
|
||||||
original.gravityStrength *= crits.gravity.getFloatValue();
|
original.gravityStrength *= crits.gravity.getFloatValue();
|
||||||
original.setMaxAge(crits.maxAge.getIntValue());
|
original.setMaxAge(crits.maxAge.getIntValue());
|
||||||
original.collidesWithWorld = crits.collide.isEnabled();
|
original.collidesWithWorld = crits.collide.getValue();
|
||||||
|
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.Freelook;
|
||||||
import me.retucio.sputnik.module.modules.camera.Rotations;
|
import me.retucio.sputnik.module.modules.camera.Rotations;
|
||||||
import me.retucio.sputnik.module.modules.misc.AntiInvis;
|
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 me.retucio.sputnik.module.modules.render.Nametags;
|
||||||
import net.minecraft.entity.*;
|
import net.minecraft.entity.*;
|
||||||
import net.minecraft.entity.passive.TameableEntity;
|
import net.minecraft.entity.passive.TameableEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
import net.minecraft.entity.projectile.PersistentProjectileEntity;
|
||||||
|
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
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.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
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.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@@ -88,7 +92,7 @@ public abstract class EntityMixin {
|
|||||||
|
|
||||||
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
|
||||||
private Text showProjectileDamage(Text original) {
|
private Text showProjectileDamage(Text original) {
|
||||||
if (!nametags.isEnabled() || !nametags.showProjectileDamage.isEnabled()) return original;
|
if (!nametags.isEnabled() || !nametags.showProjectileDamage.getValue()) return original;
|
||||||
|
|
||||||
if ((Object) this instanceof PersistentProjectileEntity arrow) { // aunque lo llame "arrow", también cubre flechas espectrales y tridentes
|
if ((Object) this instanceof PersistentProjectileEntity arrow) { // aunque lo llame "arrow", también cubre flechas espectrales y tridentes
|
||||||
String damage = nametags.getArrowDamage(arrow);
|
String damage = nametags.getArrowDamage(arrow);
|
||||||
@@ -101,7 +105,7 @@ public abstract class EntityMixin {
|
|||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
@ModifyReturnValue(method = "getCustomName", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getCustomName", at = @At("RETURN"))
|
||||||
private Text displayEntityOwner(Text original) {
|
private Text displayEntityOwner(Text original) {
|
||||||
if (!nametags.isEnabled() || !nametags.petOwner.isEnabled()) return original;
|
if (!nametags.isEnabled() || !nametags.petOwner.getValue()) return original;
|
||||||
if ((Object) this instanceof TameableEntity entity && entity.getOwnerReference() != null) {
|
if ((Object) this instanceof TameableEntity entity && entity.getOwnerReference() != null) {
|
||||||
if (original != null) return original.copy().append(" (de " + nametags.getOwnerName(entity.getOwnerReference()) + ")");
|
if (original != null) return original.copy().append(" (de " + nametags.getOwnerName(entity.getOwnerReference()) + ")");
|
||||||
else return Text.of(nametags.getOwnerName(entity.getOwnerReference()));
|
else return Text.of(nametags.getOwnerName(entity.getOwnerReference()));
|
||||||
@@ -113,7 +117,7 @@ public abstract class EntityMixin {
|
|||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
|
||||||
private Text showBabies(Text original) {
|
private Text showBabies(Text original) {
|
||||||
if (!nametags.isEnabled() || !nametags.distinguishBabies.isEnabled()) return original;
|
if (!nametags.isEnabled() || !nametags.distinguishBabies.getValue()) return original;
|
||||||
if ((Object) this instanceof LivingEntity entity && entity.isBaby()) return original.copy().append(" (baby)");
|
if ((Object) this instanceof LivingEntity entity && entity.isBaby()) return original.copy().append(" (baby)");
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
@@ -146,7 +150,16 @@ public abstract class EntityMixin {
|
|||||||
// otros
|
// otros
|
||||||
|
|
||||||
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
|
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
|
||||||
public void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
|
private void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if (ModuleManager.INSTANCE.getModuleByClass(AntiInvis.class).isEnabled()) cir.setReturnValue(false);
|
if (ModuleManager.INSTANCE.getModuleByClass(AntiInvis.class).isEnabled()) cir.setReturnValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
@Inject(method = "getStepHeight", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void modifyBoatStepHeight(CallbackInfoReturnable<Float> cir) {
|
||||||
|
BoatFly boatFly = ModuleManager.INSTANCE.getModuleByClass(BoatFly.class);
|
||||||
|
if (((Object) this) instanceof AbstractBoatEntity && boatFly.isEnabled()) {
|
||||||
|
cir.setReturnValue(boatFly.stepHeight.getFloatValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -33,10 +33,10 @@ public abstract class FogRendererMixin {
|
|||||||
if (!noRender.isEnabled()) return instance.shouldApply(cameraSubmersionType, entity);
|
if (!noRender.isEnabled()) return instance.shouldApply(cameraSubmersionType, entity);
|
||||||
String className = instance.getClass().getSimpleName();
|
String className = instance.getClass().getSimpleName();
|
||||||
|
|
||||||
if ((className.equals("BlindnessEffectFogModifier") && !noRender.blindnessEffect.isEnabled())
|
if ((className.equals("BlindnessEffectFogModifier") && !noRender.blindnessEffect.getValue())
|
||||||
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.isEnabled())
|
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.getValue())
|
||||||
|| ((className.equals("LavaFogModifier") || className.equals("WaterFogModifier")
|
|| ((className.equals("LavaFogModifier") || className.equals("WaterFogModifier")
|
||||||
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.isEnabled()))
|
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.getValue()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return instance.shouldApply(cameraSubmersionType, entity);
|
return instance.shouldApply(cameraSubmersionType, entity);
|
||||||
@@ -44,7 +44,7 @@ public abstract class FogRendererMixin {
|
|||||||
|
|
||||||
@ModifyReturnValue(method = "getFogColor", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getFogColor", at = @At("RETURN"))
|
||||||
private Vector4f modifyLavaFog(Vector4f original, Camera camera) {
|
private Vector4f modifyLavaFog(Vector4f original, Camera camera) {
|
||||||
if (noRender.isEnabled() && !noRender.fluidOverlay.isEnabled() &&
|
if (noRender.isEnabled() && !noRender.fluidOverlay.getValue() &&
|
||||||
(camera.getSubmersionType() == CameraSubmersionType.LAVA
|
(camera.getSubmersionType() == CameraSubmersionType.LAVA
|
||||||
|| camera.getSubmersionType() == CameraSubmersionType.WATER))
|
|| camera.getSubmersionType() == CameraSubmersionType.WATER))
|
||||||
return new Vector4f(original.x, original.y, original.z, 0f);
|
return new Vector4f(original.x, original.y, original.z, 0f);
|
||||||
@@ -54,6 +54,6 @@ public abstract class FogRendererMixin {
|
|||||||
|
|
||||||
@ModifyExpressionValue(method = "getFogColor", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getUnderwaterVisibility()F"))
|
@ModifyExpressionValue(method = "getFogColor", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getUnderwaterVisibility()F"))
|
||||||
private float noRenderUnderwaterFog(float original) {
|
private float noRenderUnderwaterFog(float original) {
|
||||||
return (noRender.isEnabled() && !noRender.fluidOverlay.isEnabled()) ? 0 : original;
|
return (noRender.isEnabled() && !noRender.fluidOverlay.getValue()) ? 0 : original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package me.retucio.sputnik.mixin;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.Sputnik;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
|
import me.retucio.sputnik.module.modules.render.Fonts;
|
||||||
|
import net.minecraft.client.font.FontManager;
|
||||||
|
import net.minecraft.client.font.FontStorage;
|
||||||
|
import net.minecraft.text.StyleSpriteSource;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
|
||||||
|
@Mixin(FontManager.class)
|
||||||
|
public abstract class FontManagerMixin {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public abstract FontStorage getStorageInternal(Identifier id);
|
||||||
|
|
||||||
|
@Inject(method = "getStorageInternal", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void onGetStorageInternal(Identifier id, CallbackInfoReturnable<FontStorage> cir) {
|
||||||
|
Fonts fonts = ModuleManager.INSTANCE.getModuleByClass(Fonts.class);
|
||||||
|
if (!fonts.isEnabled()) return;
|
||||||
|
|
||||||
|
if (id.equals(StyleSpriteSource.Font.DEFAULT.id())) {
|
||||||
|
cir.setReturnValue(getStorageInternal(
|
||||||
|
Identifier.of(
|
||||||
|
Sputnik.MOD_ID,
|
||||||
|
fonts.font.getValue())
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ package me.retucio.sputnik.mixin;
|
|||||||
import me.retucio.sputnik.event.events.GetFOVEvent;
|
import me.retucio.sputnik.event.events.GetFOVEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
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.render.NoRender;
|
||||||
import me.retucio.sputnik.module.modules.camera.Zoom;
|
import me.retucio.sputnik.module.modules.camera.Zoom;
|
||||||
import me.retucio.sputnik.util.interfaces.IVec3d;
|
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.MinecraftClient;
|
||||||
import net.minecraft.client.render.BufferBuilderStorage;
|
import net.minecraft.client.render.BufferBuilderStorage;
|
||||||
import net.minecraft.client.render.GameRenderer;
|
import net.minecraft.client.render.GameRenderer;
|
||||||
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
import net.minecraft.client.render.block.BlockRenderManager;
|
import net.minecraft.client.render.block.BlockRenderManager;
|
||||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
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.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
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.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
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 com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
|
||||||
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
|
||||||
|
import static me.retucio.sputnik.Sputnik.mc;
|
||||||
|
|
||||||
|
|
||||||
@Mixin(GameRenderer.class)
|
@Mixin(GameRenderer.class)
|
||||||
@@ -64,6 +68,12 @@ public abstract class GameRendererMixin {
|
|||||||
return EVENT_BUS.post(new GetFOVEvent(original)).getFov();
|
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)
|
@Inject(method = "updateCrosshairTarget", at = @At("HEAD"), cancellable = true)
|
||||||
private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo ci) {
|
private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo ci) {
|
||||||
if ((freecam.isEnabled()) && client.getCameraEntity() != null && !freecamDone) {
|
if ((freecam.isEnabled()) && client.getCameraEntity() != null && !freecamDone) {
|
||||||
@@ -110,13 +120,13 @@ public abstract class GameRendererMixin {
|
|||||||
|
|
||||||
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
|
||||||
private void renderHand(float tickProgress, boolean sleeping, Matrix4f positionMatrix, CallbackInfo ci) {
|
private void renderHand(float tickProgress, boolean sleeping, Matrix4f positionMatrix, CallbackInfo ci) {
|
||||||
if ((zoom.isEnabled() && !zoom.showHands.isEnabled())
|
if ((zoom.isEnabled() && !zoom.showHands.getValue())
|
||||||
|| (freecam.isEnabled() && !freecam.renderHands.isEnabled()))
|
|| (freecam.isEnabled() && !freecam.renderHands.getValue()))
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyVariable(method = "renderWorld", ordinal = 6, at = @At(value = "STORE"))
|
@ModifyVariable(method = "renderWorld", ordinal = 6, at = @At(value = "STORE"))
|
||||||
private float noRenderNauseaDistortion(float scaledNauseaEffectFactor) {
|
private float noRenderNauseaDistortion(float scaledNauseaEffectFactor) {
|
||||||
return (noRender.isEnabled() && !noRender.nauseaEffect.isEnabled()) ? 0 : scaledNauseaEffectFactor;
|
return (noRender.isEnabled() && !noRender.nauseaEffect.getValue()) ? 0 : scaledNauseaEffectFactor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,19 +65,19 @@ public abstract class HeldItemRendererMixin {
|
|||||||
|
|
||||||
@ModifyReturnValue(method = "shouldSkipHandAnimationOnSwap", at = @At("RETURN"))
|
@ModifyReturnValue(method = "shouldSkipHandAnimationOnSwap", at = @At("RETURN"))
|
||||||
private boolean modifySkipSwapAnimation(boolean original) {
|
private boolean modifySkipSwapAnimation(boolean original) {
|
||||||
return original || (handView.isEnabled() && handView.skipSwapping.isEnabled());
|
return original || (handView.isEnabled() && handView.skipSwapping.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "applyEatOrDrinkTransformation", at = @At(value = "INVOKE", target = "Ljava/lang/Math;pow(DD)D", shift = At.Shift.BEFORE), cancellable = true)
|
@Inject(method = "applyEatOrDrinkTransformation", at = @At(value = "INVOKE", target = "Ljava/lang/Math;pow(DD)D", shift = At.Shift.BEFORE), cancellable = true)
|
||||||
private void cancelTransformations(MatrixStack matrices, float tickDelta, Arm arm, ItemStack stack, PlayerEntity player, CallbackInfo ci) {
|
private void cancelTransformations(MatrixStack matrices, float tickDelta, Arm arm, ItemStack stack, PlayerEntity player, CallbackInfo ci) {
|
||||||
if (handView.isEnabled() && handView.noFood.isEnabled()) ci.cancel();
|
if (handView.isEnabled() && handView.noFood.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyArg(method = "updateHeldItems", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", ordinal = 2), index = 0)
|
@ModifyArg(method = "updateHeldItems", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", ordinal = 2), index = 0)
|
||||||
private float modifyEquipProgressMainhand(float value) {
|
private float modifyEquipProgressMainhand(float value) {
|
||||||
if (mc.player == null) return value;
|
if (mc.player == null) return value;
|
||||||
float progress = mc.player.getAttackCooldownProgress(1);
|
float progress = mc.player.getAttackCooldownProgress(1);
|
||||||
float modified = handView.isEnabled() && handView.oldAnimations.isEnabled() ? 1 : (float) Math.pow(progress, 3);
|
float modified = handView.isEnabled() && handView.oldAnimations.getValue() ? 1 : (float) Math.pow(progress, 3);
|
||||||
|
|
||||||
return (shouldSkipHandAnimationOnSwap(mainHand, mc.player.getMainHandStack()) ? modified : 0) - equipProgressMainHand;
|
return (shouldSkipHandAnimationOnSwap(mainHand, mc.player.getMainHandStack()) ? modified : 0) - equipProgressMainHand;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package me.retucio.sputnik.mixin;
|
package me.retucio.sputnik.mixin;
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import me.retucio.sputnik.Sputnik;
|
||||||
|
import me.retucio.sputnik.event.events.Render2DEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
@@ -28,37 +30,42 @@ public abstract class InGameHudMixin {
|
|||||||
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "render", at = @At("TAIL"))
|
||||||
|
private void onRenderHud(DrawContext ctx, RenderTickCounter tc, CallbackInfo ci) {
|
||||||
|
Sputnik.EVENT_BUS.post(new Render2DEvent(ctx, tc));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// norender
|
// norender
|
||||||
|
|
||||||
@Inject(method = "renderScoreboardSidebar*", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderScoreboardSidebar*", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderScoreboard(CallbackInfo ci) {
|
private void noRenderScoreboard(CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.scoreboard.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.scoreboard.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderTitleAndSubtitle", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderTitleAndSubtitle", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderTitles(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
|
private void noRenderTitles(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.titles.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.titles.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderNauseaOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderNauseaOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderNausea(DrawContext context, float nauseaStrength, CallbackInfo ci) {
|
private void noRenderNausea(DrawContext context, float nauseaStrength, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.nauseaEffect.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.nauseaEffect.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderSpyglassOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderSpyglassOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderSpyglass(DrawContext context, float scale, CallbackInfo ci) {
|
private void noRenderSpyglass(DrawContext context, float scale, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.spyglassOverlay.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.spyglassOverlay.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderPortalOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderPortalOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderPortal(DrawContext context, float nauseaStrength, CallbackInfo ci) {
|
private void noRenderPortal(DrawContext context, float nauseaStrength, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.portalOverlay.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.portalOverlay.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderPumpkinBlur(DrawContext context, Identifier texture, float opacity, CallbackInfo ci) {
|
private void noRenderPumpkinBlur(DrawContext context, Identifier texture, float opacity, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.pumpkinOverlay.isEnabled() && texture.getPath().equals("textures/misc/pumpkinblur.png")) ci.cancel();
|
if (noRender.isEnabled() && !noRender.pumpkinOverlay.getValue() && texture.getPath().equals("textures/misc/pumpkinblur.png")) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -77,6 +84,6 @@ public abstract class InGameHudMixin {
|
|||||||
@Inject(method = "clear", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;clear(Z)V"), cancellable = true)
|
@Inject(method = "clear", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;clear(Z)V"), cancellable = true)
|
||||||
private void onClear(CallbackInfo ci) {
|
private void onClear(CallbackInfo ci) {
|
||||||
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
||||||
if (chatPlus.isEnabled() && chatPlus.keepHistory.isEnabled()) ci.cancel();
|
if (chatPlus.isEnabled() && chatPlus.keepHistory.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,11 +27,11 @@ public abstract class InGameOverlayRendererMixin {
|
|||||||
|
|
||||||
@Inject(method = "renderFireOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderFireOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private static void noRenderFireOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsumers, Sprite sprite, CallbackInfo ci) {
|
private static void noRenderFireOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsumers, Sprite sprite, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.fireOverlay.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.fireOverlay.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderUnderwaterOverlay", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderUnderwaterOverlay", at = @At("HEAD"), cancellable = true)
|
||||||
private static void noRenderUnderwaterOverlay(MinecraftClient client, MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
|
private static void noRenderUnderwaterOverlay(MinecraftClient client, MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.fluidOverlay.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.fluidOverlay.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ public abstract class ItemEntityMixin {
|
|||||||
|
|
||||||
if (!name.equals(original)) name = name.formatted(Formatting.ITALIC);
|
if (!name.equals(original)) name = name.formatted(Formatting.ITALIC);
|
||||||
|
|
||||||
if (nametags.countItems.isEnabled()) {
|
if (nametags.countItems.getValue()) {
|
||||||
if (count > 1) return name.copy().append(" x" + count);
|
if (count > 1) return name.copy().append(" x" + count);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public abstract class ItemMixin {
|
|||||||
@Inject(method = "appendTooltip", at = @At("HEAD"))
|
@Inject(method = "appendTooltip", at = @At("HEAD"))
|
||||||
private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type, CallbackInfo ci) {
|
private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type, CallbackInfo ci) {
|
||||||
ShulkerPeek shulkerPeek = ModuleManager.INSTANCE.getModuleByClass(ShulkerPeek.class);
|
ShulkerPeek shulkerPeek = ModuleManager.INSTANCE.getModuleByClass(ShulkerPeek.class);
|
||||||
if (!shulkerPeek.isEnabled() || !shulkerPeek.showTooltips.isEnabled()) return;
|
if (!shulkerPeek.isEnabled() || !shulkerPeek.showTooltips.getValue()) return;
|
||||||
|
|
||||||
if (stack.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof ShulkerBoxBlock) {
|
if (stack.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof ShulkerBoxBlock) {
|
||||||
if (ShulkerPeek.isShulkerEmpty(stack)) {
|
if (ShulkerPeek.isShulkerEmpty(stack)) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public abstract class KeyInputMixin extends Input {
|
|||||||
@Inject(method = "tick", at = @At("TAIL"))
|
@Inject(method = "tick", at = @At("TAIL"))
|
||||||
private void isPressed(CallbackInfo ci) {
|
private void isPressed(CallbackInfo ci) {
|
||||||
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
if (freecam.isEnabled() && freecam.stayCrouching.isEnabled() && freecam.isCrouching())
|
if (freecam.isEnabled() && freecam.stayCrouching.getValue() && freecam.isCrouching())
|
||||||
playerInput = new PlayerInput(
|
playerInput = new PlayerInput(
|
||||||
false, false,
|
false, false,
|
||||||
false, false,
|
false, false,
|
||||||
|
|||||||
@@ -55,6 +55,6 @@ public abstract class LightmapTextureManagerMixin {
|
|||||||
|
|
||||||
@Inject(method = "getDarkness", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "getDarkness", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderDarkness(LivingEntity entity, float factor, float tickProgress, CallbackInfoReturnable<Float> cir) {
|
private void noRenderDarkness(LivingEntity entity, float factor, float tickProgress, CallbackInfoReturnable<Float> cir) {
|
||||||
if (noRender.isEnabled() && !noRender.darknessEffect.isEnabled()) cir.setReturnValue(0f);
|
if (noRender.isEnabled() && !noRender.darknessEffect.getValue()) cir.setReturnValue(0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package me.retucio.sputnik.mixin;
|
package me.retucio.sputnik.mixin;
|
||||||
|
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.player.ElytraBounce;
|
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.client.network.ClientPlayerEntity;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
@@ -12,6 +13,7 @@ import org.spongepowered.asm.mixin.Unique;
|
|||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
import static me.retucio.sputnik.Sputnik.mc;
|
import static me.retucio.sputnik.Sputnik.mc;
|
||||||
|
|
||||||
@@ -26,7 +28,7 @@ public abstract class LivingEntityMixin {
|
|||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
@Inject(method = "tickMovement", at = @At("TAIL"))
|
@Inject(method = "tickMovement", at = @At("TAIL"))
|
||||||
public void recastIfLanded(CallbackInfo ci) {
|
private void recastIfLanded(CallbackInfo ci) {
|
||||||
ElytraBounce bounce = ModuleManager.INSTANCE.getModuleByClass(ElytraBounce.class);
|
ElytraBounce bounce = ModuleManager.INSTANCE.getModuleByClass(ElytraBounce.class);
|
||||||
|
|
||||||
if (!((Object) this instanceof ClientPlayerEntity)
|
if (!((Object) this instanceof ClientPlayerEntity)
|
||||||
@@ -47,4 +49,11 @@ public abstract class LivingEntityMixin {
|
|||||||
|
|
||||||
prevElytra = elytra;
|
prevElytra = elytra;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Inject(method = "getStepHeight", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void step(CallbackInfoReturnable<Float> cir) {
|
||||||
|
Step step = ModuleManager.INSTANCE.getModuleByClass(Step.class);
|
||||||
|
if (step.isEnabled()) cir.setReturnValue(step.height.getFloatValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -40,12 +40,12 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity> {
|
|||||||
|
|
||||||
@ModifyExpressionValue(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isSneaky()Z"))
|
@ModifyExpressionValue(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isSneaky()Z"))
|
||||||
private boolean renderSneakingPlayerNametags(boolean original) {
|
private boolean renderSneakingPlayerNametags(boolean original) {
|
||||||
return (nametags.isEnabled() && nametags.alwaysVisible.isEnabled()) || original;
|
return (nametags.isEnabled() && nametags.alwaysVisible.getValue()) || original;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyExpressionValue(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isInvisibleTo(Lnet/minecraft/entity/player/PlayerEntity;)Z"))
|
@ModifyExpressionValue(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isInvisibleTo(Lnet/minecraft/entity/player/PlayerEntity;)Z"))
|
||||||
private boolean renderInvisPlayerNametags(boolean original) {
|
private boolean renderInvisPlayerNametags(boolean original) {
|
||||||
if (nametags.isEnabled() && nametags.alwaysVisible.isEnabled()) return false;
|
if (nametags.isEnabled() && nametags.alwaysVisible.getValue()) return false;
|
||||||
else return original;
|
else return original;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity> {
|
|||||||
@Inject(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At("RETURN"), cancellable = true)
|
@Inject(method = "hasLabel(Lnet/minecraft/entity/LivingEntity;D)Z", at = @At("RETURN"), cancellable = true)
|
||||||
private void renderSelfNametag(T livingEntity, double d, CallbackInfoReturnable<Boolean> cir) {
|
private void renderSelfNametag(T livingEntity, double d, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if (livingEntity instanceof PlayerEntity player) {
|
if (livingEntity instanceof PlayerEntity player) {
|
||||||
if (player == mc.player && nametags.showSelf.isEnabled()) {
|
if (player == mc.player && nametags.showSelf.getValue()) {
|
||||||
cir.setReturnValue(true);
|
cir.setReturnValue(true);
|
||||||
cir.cancel();
|
cir.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,9 @@ import net.minecraft.client.gui.screen.Screen;
|
|||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.objectweb.asm.Opcodes;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.*;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@@ -28,6 +27,12 @@ public abstract class MinecraftClientMixin {
|
|||||||
@Shadow
|
@Shadow
|
||||||
private int itemUseCooldown;
|
private int itemUseCooldown;
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
public int attackCooldown;
|
||||||
|
|
||||||
|
|
||||||
|
// eventos
|
||||||
|
|
||||||
@Inject(method = "tick", at = @At("HEAD"))
|
@Inject(method = "tick", at = @At("HEAD"))
|
||||||
private void onTickPre(CallbackInfo ci) {
|
private void onTickPre(CallbackInfo ci) {
|
||||||
Sputnik.INSTANCE.onTick();
|
Sputnik.INSTANCE.onTick();
|
||||||
@@ -50,9 +55,10 @@ public abstract class MinecraftClientMixin {
|
|||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "isTelemetryEnabledByApi", at = @At("RETURN"), cancellable = true)
|
@Inject(method = "joinWorld", at = @At("HEAD"), cancellable = true)
|
||||||
private void disableMicropenisTelemetryShi(CallbackInfoReturnable<Boolean> cir) {
|
private void onJoinWorld(ClientWorld world, CallbackInfo ci) {
|
||||||
cir.setReturnValue(false);
|
JoinWorldEvent event = Sputnik.EVENT_BUS.post(new JoinWorldEvent(world));
|
||||||
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getStackInHand(Lnet/minecraft/util/Hand;)Lnet/minecraft/item/ItemStack;"), cancellable = true)
|
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getStackInHand(Lnet/minecraft/util/Hand;)Lnet/minecraft/item/ItemStack;"), cancellable = true)
|
||||||
@@ -62,16 +68,21 @@ public abstract class MinecraftClientMixin {
|
|||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// telemetría
|
||||||
|
|
||||||
|
@Inject(method = "isTelemetryEnabledByApi", at = @At("RETURN"), cancellable = true)
|
||||||
|
private void disableMicropenisTelemetryShi(CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
cir.setReturnValue(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// precoz
|
||||||
|
|
||||||
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Z"))
|
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Z"))
|
||||||
private void modifyItemUseCooldown(CallbackInfo ci, @Local ItemStack stack) {
|
private void modifyItemUseCooldown(CallbackInfo ci, @Local ItemStack stack) {
|
||||||
FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
|
FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
|
||||||
if (!fastUse.isEnabled()) return;
|
if (!fastUse.isEnabled()) return;
|
||||||
itemUseCooldown = fastUse.getCooldown(stack);
|
itemUseCooldown = fastUse.getCooldown(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "joinWorld", at = @At("HEAD"), cancellable = true)
|
|
||||||
private void onJoinWorld(ClientWorld world, CallbackInfo ci) {
|
|
||||||
JoinWorldEvent event = Sputnik.EVENT_BUS.post(new JoinWorldEvent(world));
|
|
||||||
if (event.isCancelled()) ci.cancel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ public abstract class PlayerEntityMixin extends LivingEntity {
|
|||||||
@ModifyReturnValue(method = "getDisplayName", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getDisplayName", at = @At("RETURN"))
|
||||||
private Text addHealthIndicator(Text original) {
|
private Text addHealthIndicator(Text original) {
|
||||||
Nametags nametags = ModuleManager.INSTANCE.getModuleByClass(Nametags.class);
|
Nametags nametags = ModuleManager.INSTANCE.getModuleByClass(Nametags.class);
|
||||||
if (!nametags.isEnabled() || !nametags.health.isEnabled()) return original;
|
if (!nametags.isEnabled() || !nametags.health.getValue()) return original;
|
||||||
|
|
||||||
float health = getHealth();
|
float health = getHealth();
|
||||||
float absorption = getAbsorptionAmount();
|
float absorption = getAbsorptionAmount();
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ public abstract class SkyRendererMixin {
|
|||||||
|
|
||||||
@Inject(method = "renderSun", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderSun", at = @At("HEAD"), cancellable = true)
|
||||||
private void onRenderSun(float alpha, MatrixStack matrices, CallbackInfo ci) {
|
private void onRenderSun(float alpha, MatrixStack matrices, CallbackInfo ci) {
|
||||||
if (timeChanger.isEnabled() && !timeChanger.renderSun.isEnabled()) ci.cancel();
|
if (timeChanger.isEnabled() && !timeChanger.renderSun.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderMoon", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderMoon", at = @At("HEAD"), cancellable = true)
|
||||||
private void onRenderMoon(MoonPhase moonPhase, float alpha, MatrixStack matrices, CallbackInfo ci) {
|
private void onRenderMoon(MoonPhase moonPhase, float alpha, MatrixStack matrices, CallbackInfo ci) {
|
||||||
if (!timeChanger.isEnabled()) return;
|
if (!timeChanger.isEnabled()) return;
|
||||||
if (!timeChanger.renderMoon.isEnabled()) ci.cancel();
|
if (!timeChanger.renderMoon.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyArg(method = "renderCelestialBodies", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/SkyRendering;renderMoon(Lnet/minecraft/world/MoonPhase;FLnet/minecraft/client/util/math/MatrixStack;)V"))
|
@ModifyArg(method = "renderCelestialBodies", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/SkyRendering;renderMoon(Lnet/minecraft/world/MoonPhase;FLnet/minecraft/client/util/math/MatrixStack;)V"))
|
||||||
@@ -45,12 +45,12 @@ public abstract class SkyRendererMixin {
|
|||||||
|
|
||||||
@Inject(method = "renderStars", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderStars", at = @At("HEAD"), cancellable = true)
|
||||||
private void onRenderStars(float brightness, MatrixStack matrices, CallbackInfo ci) {
|
private void onRenderStars(float brightness, MatrixStack matrices, CallbackInfo ci) {
|
||||||
if (timeChanger.isEnabled() && !timeChanger.renderStars.isEnabled()) ci.cancel();
|
if (timeChanger.isEnabled() && !timeChanger.renderStars.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "drawEndLightFlash", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "drawEndLightFlash", at = @At("HEAD"), cancellable = true)
|
||||||
private void onEndFlash(MatrixStack matrixStack, float f, float skyFactor, float pitch, CallbackInfo ci) {
|
private void onEndFlash(MatrixStack matrixStack, float f, float skyFactor, float pitch, CallbackInfo ci) {
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
if (noRender.isEnabled() && !noRender.endFlashes.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.endFlashes.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,8 +21,8 @@ public abstract class StatusEffectFogModifierMixin {
|
|||||||
public boolean noRenderBadEffects(boolean original) {
|
public boolean noRenderBadEffects(boolean original) {
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
if (!noRender.isEnabled()) return original;
|
if (!noRender.isEnabled()) return original;
|
||||||
if (getStatusEffect() == StatusEffects.BLINDNESS && !noRender.blindnessEffect.isEnabled()) return false;
|
if (getStatusEffect() == StatusEffects.BLINDNESS && !noRender.blindnessEffect.getValue()) return false;
|
||||||
if (getStatusEffect() == StatusEffects.DARKNESS && !noRender.darknessEffect.isEnabled()) return false;
|
if (getStatusEffect() == StatusEffects.DARKNESS && !noRender.darknessEffect.getValue()) return false;
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,6 @@ public abstract class StringHelperMixin {
|
|||||||
@ModifyArg(method = "truncateChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringHelper;truncate(Ljava/lang/String;IZ)Ljava/lang/String;"), index = 1)
|
@ModifyArg(method = "truncateChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringHelper;truncate(Ljava/lang/String;IZ)Ljava/lang/String;"), index = 1)
|
||||||
private static int onTruncate(int maxLength) {
|
private static int onTruncate(int maxLength) {
|
||||||
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
||||||
return ((chatPlus.isEnabled() && chatPlus.noCharLimit.isEnabled()) ? Integer.MAX_VALUE : maxLength);
|
return ((chatPlus.isEnabled() && chatPlus.noCharLimit.getValue()) ? Integer.MAX_VALUE : maxLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ public abstract class StuckArrowsFeatureRendererMixin {
|
|||||||
@ModifyReturnValue(method = "getObjectCount", at = @At("RETURN"))
|
@ModifyReturnValue(method = "getObjectCount", at = @At("RETURN"))
|
||||||
private int noRenderStuckArrows(int original) {
|
private int noRenderStuckArrows(int original) {
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
if (noRender.isEnabled() && !noRender.stuckArrows.isEnabled()) return 0;
|
if (noRender.isEnabled() && !noRender.stuckArrows.getValue()) return 0;
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,17 +24,17 @@ public abstract class TextRendererDrawerMixin {
|
|||||||
|
|
||||||
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isBold()Z"))
|
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isBold()Z"))
|
||||||
private boolean noRenderBold(Style style) {
|
private boolean noRenderBold(Style style) {
|
||||||
return !(noRender.isEnabled() && !noRender.bold.isEnabled()) && style.isBold();
|
return !(noRender.isEnabled() && !noRender.bold.getValue()) && style.isBold();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isUnderlined()Z"))
|
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isUnderlined()Z"))
|
||||||
private boolean noRenderUnderlined(Style style) {
|
private boolean noRenderUnderlined(Style style) {
|
||||||
return !(noRender.isEnabled() && !noRender.underlined.isEnabled()) && style.isUnderlined();
|
return !(noRender.isEnabled() && !noRender.underlined.getValue()) && style.isUnderlined();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isStrikethrough()Z"))
|
@Redirect(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isStrikethrough()Z"))
|
||||||
private boolean noRenderStrikethrough(Style style) {
|
private boolean noRenderStrikethrough(Style style) {
|
||||||
return !(noRender.isEnabled() && !noRender.strikethrough.isEnabled()) && style.isStrikethrough();
|
return !(noRender.isEnabled() && !noRender.strikethrough.getValue()) && style.isStrikethrough();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ModifyArg(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer$Drawer;getRenderColor(Lnet/minecraft/text/TextColor;)I"))
|
@ModifyArg(method = "accept(ILnet/minecraft/text/Style;Lnet/minecraft/client/font/BakedGlyph;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer$Drawer;getRenderColor(Lnet/minecraft/text/TextColor;)I"))
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ public abstract class TextRendererMixin {
|
|||||||
@ModifyExpressionValue(method = "getGlyph", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isObfuscated()Z"))
|
@ModifyExpressionValue(method = "getGlyph", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isObfuscated()Z"))
|
||||||
private boolean noRenderMTS(boolean original) {
|
private boolean noRenderMTS(boolean original) {
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
return (!noRender.isEnabled() || noRender.scrambledText.isEnabled()) && original;
|
return (!noRender.isEnabled() || noRender.scrambledText.getValue()) && original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,14 +29,14 @@ public abstract class WeatherRenderingMixin {
|
|||||||
|
|
||||||
@Inject(method = "addParticlesAndSound", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;addParticleClient(Lnet/minecraft/particle/ParticleEffect;DDDDDD)V"), cancellable = true)
|
@Inject(method = "addParticlesAndSound", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;addParticleClient(Lnet/minecraft/particle/ParticleEffect;DDDDDD)V"), cancellable = true)
|
||||||
private void noRainParticles(ClientWorld world, Camera camera, int ticks, ParticlesMode particlesMode, int weatherRadius, CallbackInfo ci) {
|
private void noRainParticles(ClientWorld world, Camera camera, int ticks, ParticlesMode particlesMode, int weatherRadius, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled() && !noRender.rain.isEnabled()) ci.cancel();
|
if (noRender.isEnabled() && !noRender.rain.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "renderPrecipitation", at = @At("HEAD"))
|
@Inject(method = "renderPrecipitation", at = @At("HEAD"))
|
||||||
private void noRenderRainAndSnow(VertexConsumerProvider vertexConsumers, Vec3d pos, WeatherRenderState weatherRenderState, CallbackInfo ci) {
|
private void noRenderRainAndSnow(VertexConsumerProvider vertexConsumers, Vec3d pos, WeatherRenderState weatherRenderState, CallbackInfo ci) {
|
||||||
if (noRender.isEnabled()) {
|
if (noRender.isEnabled()) {
|
||||||
if (!noRender.rain.isEnabled()) weatherRenderState.rainPieces.clear();
|
if (!noRender.rain.getValue()) weatherRenderState.rainPieces.clear();
|
||||||
if (!noRender.snow.isEnabled()) weatherRenderState.snowPieces.clear();
|
if (!noRender.snow.getValue()) weatherRenderState.snowPieces.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ package me.retucio.sputnik.mixin;
|
|||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import com.mojang.blaze3d.buffers.GpuBufferSlice;
|
import com.mojang.blaze3d.buffers.GpuBufferSlice;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.RenderWorldEvent;
|
import me.retucio.sputnik.event.events.Render3DEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.render.BlockOutline;
|
import me.retucio.sputnik.module.modules.render.BlockOutline;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
@@ -12,16 +12,12 @@ import net.minecraft.client.render.*;
|
|||||||
import net.minecraft.client.render.state.WorldRenderState;
|
import net.minecraft.client.render.state.WorldRenderState;
|
||||||
import net.minecraft.client.util.ObjectAllocator;
|
import net.minecraft.client.util.ObjectAllocator;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.ColorHelper;
|
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.RotationAxis;
|
||||||
import net.minecraft.util.profiler.Profiler;
|
import net.minecraft.util.profiler.Profiler;
|
||||||
import org.joml.Matrix4f;
|
import org.joml.Matrix4f;
|
||||||
import org.joml.Vector4f;
|
import org.joml.Vector4f;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@@ -47,7 +43,7 @@ public abstract class WorldRendererMixin {
|
|||||||
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(camera.getYaw() + 180f));
|
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(camera.getYaw() + 180f));
|
||||||
|
|
||||||
profiler.push(Sputnik.MOD_ID + "-3d");
|
profiler.push(Sputnik.MOD_ID + "-3d");
|
||||||
EVENT_BUS.post(new RenderWorldEvent(matrices, tickCounter, camera));
|
EVENT_BUS.post(new Render3DEvent(matrices, tickCounter, camera));
|
||||||
|
|
||||||
profiler.pop();
|
profiler.pop();
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
@@ -56,21 +52,28 @@ public abstract class WorldRendererMixin {
|
|||||||
@Inject(method = "renderTargetBlockOutline", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "renderTargetBlockOutline", at = @At("HEAD"), cancellable = true)
|
||||||
private void noRenderBlockOutlinesFreecam(VertexConsumerProvider.Immediate immediate, MatrixStack matrices, boolean renderBlockOutline, WorldRenderState renderStates, CallbackInfo ci) {
|
private void noRenderBlockOutlinesFreecam(VertexConsumerProvider.Immediate immediate, MatrixStack matrices, boolean renderBlockOutline, WorldRenderState renderStates, CallbackInfo ci) {
|
||||||
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
|
||||||
if (freecam.isEnabled() && !freecam.blockOutlines.isEnabled()) ci.cancel();
|
if (freecam.isEnabled() && !freecam.blockOutlines.getValue()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", at = @At("HEAD"), cancellable = true)
|
||||||
private void hasBlindnessOrDarkness(Camera camera, CallbackInfoReturnable<Boolean> cir) {
|
private void hasBlindnessOrDarkness(Camera camera, CallbackInfoReturnable<Boolean> cir) {
|
||||||
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
|
||||||
if (!noRender.isEnabled()) return;
|
if (!noRender.isEnabled()) return;
|
||||||
if (!noRender.blindnessEffect.isEnabled() || !noRender.darknessEffect.isEnabled()) cir.setReturnValue(null);
|
if (!noRender.blindnessEffect.getValue() || !noRender.darknessEffect.getValue()) cir.setReturnValue(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "renderTargetBlockOutline", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/ColorHelper;toAlpha(I)I"))
|
|
||||||
private int modifyBlockOutlineColor(int alpha) {
|
|
||||||
BlockOutline outline = ModuleManager.INSTANCE.getModuleByClass(BlockOutline.class);
|
|
||||||
if (!outline.isEnabled()) return ColorHelper.toAlpha(alpha);
|
|
||||||
|
|
||||||
|
@ModifyArg(method = "renderTargetBlockOutline", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;drawBlockOutline(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;DDDLnet/minecraft/client/render/state/OutlineRenderState;IF)V"))
|
||||||
|
private int modifyBlockOutlineColor(int original) {
|
||||||
|
BlockOutline outline = ModuleManager.INSTANCE.getModuleByClass(BlockOutline.class);
|
||||||
|
if (!outline.isEnabled()) return original;
|
||||||
return outline.color.getRGB();
|
return outline.color.getRGB();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyArg(method = "renderTargetBlockOutline", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;drawBlockOutline(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;DDDLnet/minecraft/client/render/state/OutlineRenderState;IF)V"))
|
||||||
|
private float modifyBlockOutlineLineWidth(float original) {
|
||||||
|
BlockOutline outline = ModuleManager.INSTANCE.getModuleByClass(BlockOutline.class);
|
||||||
|
if (!outline.isEnabled()) return original;
|
||||||
|
return outline.lineWidth.getFloatValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package me.retucio.sputnik.mixin.accessor;
|
||||||
|
|
||||||
|
import net.minecraft.block.AbstractBlock;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Mutable;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
@Mixin(AbstractBlock.class)
|
||||||
|
public interface AbstractBlockAccessor {
|
||||||
|
|
||||||
|
@Mutable @Accessor("slipperiness")
|
||||||
|
void setSlipperiness(float slipperiness);
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ public enum Category {
|
|||||||
|
|
||||||
PLAYER("jugador"),
|
PLAYER("jugador"),
|
||||||
WORLD("mundo"),
|
WORLD("mundo"),
|
||||||
|
MOVEMENT("movimiento"),
|
||||||
|
|
||||||
CAMERA("cámara"),
|
CAMERA("cámara"),
|
||||||
RENDER("renderizado"),
|
RENDER("renderizado"),
|
||||||
@@ -11,7 +12,9 @@ public enum Category {
|
|||||||
NETWORK("red"),
|
NETWORK("red"),
|
||||||
|
|
||||||
CLIENT("cliente"),
|
CLIENT("cliente"),
|
||||||
MISC("misc.");
|
MISC("misc."),
|
||||||
|
|
||||||
|
ALL("todos");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
Category(String name) { this.name = name; }
|
Category(String name) { this.name = name; }
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import me.retucio.sputnik.Sputnik;
|
|||||||
import me.retucio.sputnik.config.ConfigManager;
|
import me.retucio.sputnik.config.ConfigManager;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.ToggleModuleEvent;
|
import me.retucio.sputnik.event.events.sputnik.ToggleModuleEvent;
|
||||||
import me.retucio.sputnik.module.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
import me.retucio.sputnik.module.settings.Setting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
|
import me.retucio.sputnik.module.setting.Setting;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
@@ -33,46 +34,64 @@ public class Module {
|
|||||||
protected KeySetting bind = new KeySetting("tecla", "tecla asignada al módulo, ESC para desactivar", GLFW.GLFW_KEY_UNKNOWN);
|
protected KeySetting bind = new KeySetting("tecla", "tecla asignada al módulo, ESC para desactivar", GLFW.GLFW_KEY_UNKNOWN);
|
||||||
protected BooleanSetting notify = new BooleanSetting("notificar", "notificar en el chat al activar / desactivar", true);
|
protected BooleanSetting notify = new BooleanSetting("notificar", "notificar en el chat al activar / desactivar", true);
|
||||||
|
|
||||||
private final List<Setting> settings = new ArrayList<>();
|
protected final List<SettingGroup> sgs = new ArrayList<>();
|
||||||
|
protected final SettingGroup sgGeneral = addSg(new SettingGroup("general", true));
|
||||||
|
|
||||||
protected MinecraftClient mc = MinecraftClient.getInstance();
|
protected MinecraftClient mc = MinecraftClient.getInstance();
|
||||||
|
|
||||||
|
|
||||||
public Module(String name, String description, Category category) {
|
public Module(String name, String description, Category category) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
addSettings(bind, keyMode, notify);
|
sgGeneral.addAll(bind, keyMode, notify);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Module(String name, String description, Category category, int key) {
|
public Module(String name, String description, Category category, int key) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
addSettings(bind, keyMode, notify);
|
sgGeneral.addAll(bind, keyMode, notify);
|
||||||
this.bind.setDefaultKey(key);
|
this.bind.setDefaultValue(key);
|
||||||
|
|
||||||
// puto marcos
|
// puto marcos
|
||||||
if (ConfigManager.getConfig().settings
|
if (ConfigManager.getConfig().settings
|
||||||
.get(this.getName() + ":" + bind.getName()) == null)
|
.get(this.getName() + ":" + bind.getName()) == null)
|
||||||
this.bind.setKey(key);
|
this.bind.setValue(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ajustes
|
// ajustes
|
||||||
public List<Setting> getSettings() {
|
|
||||||
|
public SettingGroup addSg(SettingGroup sg) {
|
||||||
|
sgs.add(sg);
|
||||||
|
sg.setModule(this);
|
||||||
|
return sg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SettingGroup> getSgs() {
|
||||||
|
return sgs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SettingGroup getSg(String name) {
|
||||||
|
for (SettingGroup sg : sgs) {
|
||||||
|
if (sg.getName().equals(name)) {
|
||||||
|
return sg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SettingGroup getSgGeneral() {
|
||||||
|
return sgGeneral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Setting<?>> getSettings() {
|
||||||
|
List<Setting<?>> settings = new ArrayList<>();
|
||||||
|
sgs.forEach(sg -> sg.forEach(settings::add));
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public <S extends Setting> S addSetting(Setting setting) {
|
|
||||||
settings.add(setting);
|
|
||||||
setting.setModule(this);
|
|
||||||
return (S) setting; // por conveniencia
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addSettings(Setting... settings) {
|
|
||||||
for (Setting setting : settings) addSetting(setting);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// encendido y apagado del módulo
|
// encendido y apagado del módulo
|
||||||
public void toggle() {
|
public void toggle() {
|
||||||
@@ -83,7 +102,7 @@ public class Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
if (notify.isEnabled()) ChatUtil.info(getName() + " fue activado");
|
if (notify.getValue()) ChatUtil.info(getName() + " fue activado");
|
||||||
for (Method method : getClass().getDeclaredMethods())
|
for (Method method : getClass().getDeclaredMethods())
|
||||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
||||||
Sputnik.EVENT_BUS.register(this);
|
Sputnik.EVENT_BUS.register(this);
|
||||||
@@ -93,16 +112,15 @@ public class Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (notify.isEnabled()) ChatUtil.info(getName() + " fue desactivado");
|
if (notify.getValue()) ChatUtil.info(getName() + " fue desactivado");
|
||||||
if (Sputnik.EVENT_BUS.isRegistered(this))
|
if (Sputnik.EVENT_BUS.isRegistered(this))
|
||||||
Sputnik.EVENT_BUS.unregister(this);
|
Sputnik.EVENT_BUS.unregister(this);
|
||||||
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
|
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// otros métodos
|
// tick (ejecutado 20 veces por segundo)
|
||||||
public void onTick() {}
|
public void onTick() {}
|
||||||
public void onKey(int key, int action) {}
|
|
||||||
|
|
||||||
// getters y setters
|
// getters y setters
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -150,16 +168,16 @@ public class Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
return bind.getKey();
|
return bind.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKey(int key) {
|
public void setKey(int key) {
|
||||||
bind.setKey(key);
|
bind.setValue(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assignKey(int key) {
|
public void assignKey(int key) {
|
||||||
bind.setDefaultKey(key);
|
bind.setDefaultValue(key);
|
||||||
bind.setKey(key);
|
bind.setValue(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeySetting getBind() {
|
public KeySetting getBind() {
|
||||||
|
|||||||
@@ -2,15 +2,19 @@ package me.retucio.sputnik.module;
|
|||||||
|
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.module.modules.camera.*;
|
import me.retucio.sputnik.module.modules.client.DiscordRPC;
|
||||||
import me.retucio.sputnik.module.modules.client.HUD;
|
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.misc.*;
|
||||||
|
import me.retucio.sputnik.module.modules.movement.*;
|
||||||
import me.retucio.sputnik.module.modules.network.*;
|
import me.retucio.sputnik.module.modules.network.*;
|
||||||
import me.retucio.sputnik.module.modules.player.*;
|
import me.retucio.sputnik.module.modules.player.*;
|
||||||
import me.retucio.sputnik.module.modules.render.*;
|
import me.retucio.sputnik.module.modules.render.*;
|
||||||
import me.retucio.sputnik.module.modules.render.CritsPlus;
|
import me.retucio.sputnik.module.modules.render.CritsPlus;
|
||||||
import me.retucio.sputnik.module.modules.world.*;
|
import me.retucio.sputnik.module.modules.world.*;
|
||||||
|
import me.retucio.sputnik.util.MiscUtil;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -28,55 +32,18 @@ public class ModuleManager {
|
|||||||
addModules();
|
addModules();
|
||||||
}
|
}
|
||||||
|
|
||||||
// por orden alfabético y todo, flipas
|
|
||||||
private void addModules() {
|
private void addModules() {
|
||||||
modules.add(new AntiInvis());
|
// añadir los módulos
|
||||||
modules.add(new AnvilFont());
|
addCamera();
|
||||||
modules.add(new AttributeSwapper());
|
addClient();
|
||||||
modules.add(new AutoSign());
|
addMisc();
|
||||||
modules.add(new BlockESP());
|
addMovement();
|
||||||
modules.add(new BlockOutline());
|
addNetwork();
|
||||||
modules.add(new BossbarStack());
|
addPlayer();
|
||||||
modules.add(new BreakingProgress());
|
addRender();
|
||||||
modules.add(new BungeecordSpoofer());
|
addWorld();
|
||||||
modules.add(new Capes());
|
|
||||||
modules.add(new ChatPlus());
|
|
||||||
modules.add(new ColoredSigns());
|
|
||||||
modules.add(new CritsPlus());
|
|
||||||
modules.add(new DamageOverlay());
|
|
||||||
modules.add(new ElytraBounce());
|
|
||||||
modules.add(new FakePlayer());
|
|
||||||
modules.add(new FastUse());
|
|
||||||
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 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 PerspectivePlus());
|
|
||||||
modules.add(new PortalGUI());
|
|
||||||
modules.add(new Racist());
|
|
||||||
modules.add(new Reconnect());
|
|
||||||
modules.add(new Rotations());
|
|
||||||
modules.add(new RPackBypass());
|
|
||||||
modules.add(new SafeWalk());
|
|
||||||
modules.add(new ScreenshotPlus());
|
|
||||||
modules.add(new ShulkerPeek());
|
|
||||||
modules.add(new TimeChanger());
|
|
||||||
modules.add(new UIMove());
|
|
||||||
modules.add(new WarnLowDurability());
|
|
||||||
modules.add(new Zoom());
|
|
||||||
|
|
||||||
modules.sort(Comparator.comparing(module -> module.getName().toLowerCase()));
|
modules.sort(Comparator.comparing(module -> MiscUtil.removeAccentMarks(module.getName().toLowerCase())));
|
||||||
|
|
||||||
// registrar los "listeners" necesarios
|
// registrar los "listeners" necesarios
|
||||||
for (Module module : getEnabledModules()) {
|
for (Module module : getEnabledModules()) {
|
||||||
@@ -89,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)
|
// para obtener módulos más fácilmente (por nombre, clase, o la lista completa)
|
||||||
public List<Module> getModules() {
|
public List<Module> getModules() {
|
||||||
@@ -105,7 +168,8 @@ public class ModuleManager {
|
|||||||
|
|
||||||
public Module getModuleByName(String name) {
|
public Module getModuleByName(String name) {
|
||||||
for (Module module : modules)
|
for (Module module : modules)
|
||||||
if (module.getName().equalsIgnoreCase(name)) return module;
|
if (MiscUtil.removeAccentMarks(module.getName()).equalsIgnoreCase(name))
|
||||||
|
return module;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import me.retucio.sputnik.event.SubscribeEvent;
|
|||||||
import me.retucio.sputnik.event.events.*;
|
import me.retucio.sputnik.event.events.*;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
|
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.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import me.retucio.sputnik.util.MiscUtil;
|
import me.retucio.sputnik.util.MiscUtil;
|
||||||
@@ -41,21 +42,22 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
public class Freecam extends Module {
|
public class Freecam extends Module {
|
||||||
|
|
||||||
// ajustes
|
// ajustes
|
||||||
|
SettingGroup sgSpeed = addSg(new SettingGroup("velocidad", true));
|
||||||
|
|
||||||
public BooleanSetting toggleOnDamage = addSetting(new BooleanSetting("desactivar al recibir daño", "desactiva el módulo tras recibir daño", true));
|
public BooleanSetting toggleOnDamage = sgGeneral.add(new BooleanSetting("desactivar al recibir daño", "desactiva el módulo tras recibir daño", true));
|
||||||
public BooleanSetting reloadChunks = addSetting(new BooleanSetting("recargar chunks", "recargar chunks para arreglar el culling de las cuevas", true));
|
public BooleanSetting reloadChunks = sgGeneral.add(new BooleanSetting("recargar chunks", "recargar chunks para arreglar el culling de las cuevas", true));
|
||||||
public BooleanSetting renderHands = addSetting(new BooleanSetting("manos visibles", "decide si se renderizan las manos mientras la cámara esté libre", true));
|
public BooleanSetting renderHands = sgGeneral.add(new BooleanSetting("manos visibles", "decide si se renderizan las manos mientras la cámara esté libre", true));
|
||||||
public BooleanSetting stayCrouching = addSetting(new BooleanSetting("mantenerse agachado", "mantener al jugador agachado tras entrar en el modo de cámara libre", false));
|
public BooleanSetting stayCrouching = sgGeneral.add(new BooleanSetting("mantenerse agachado", "mantener al jugador agachado tras entrar en el modo de cámara libre", false));
|
||||||
public BooleanSetting staticView = addSetting(new BooleanSetting("visión estática", "desactiva ajustes que muevan la cámara", true));
|
public BooleanSetting staticView = sgGeneral.add(new BooleanSetting("visión estática", "desactiva ajustes que muevan la cámara", true));
|
||||||
public BooleanSetting cancelActionPackets = addSetting(new BooleanSetting("cancelar paquetes", "evita flaggear el anticheat al interactuar con bloques / entidades", true));
|
public BooleanSetting cancelActionPackets = sgGeneral.add(new BooleanSetting("cancelar paquetes", "evita flaggear el anticheat al interactuar con bloques / entidades", true));
|
||||||
public BooleanSetting blockOutlines = addSetting(new BooleanSetting("contorno de bloques", "mostrar el contorno de los bloques estando en el modo de cámara libre", true));
|
public BooleanSetting blockOutlines = sgGeneral.add(new BooleanSetting("contorno de bloques", "mostrar el contorno de los bloques estando en el modo de cámara libre", true));
|
||||||
|
|
||||||
public NumberSetting speedSetting = addSetting(new NumberSetting(
|
public NumberSetting speedSetting = sgSpeed.add(new NumberSetting(
|
||||||
"velocidad", "velocidad de movimiento de la cámara",
|
"velocidad", "velocidad de movimiento de la cámara",
|
||||||
1, 0, 10, 0.2));
|
1, 0, 10, 0.2));
|
||||||
|
|
||||||
public KeySetting scrollKey = addSetting(new KeySetting("tecla del scroll", "tecla a mantener pulsada para cambiar velocidad con el scroll", GLFW.GLFW_KEY_LEFT_CONTROL));
|
public KeySetting scrollKey = sgSpeed.add(new KeySetting("tecla del scroll", "tecla a mantener pulsada para cambiar velocidad con el scroll", GLFW.GLFW_KEY_LEFT_CONTROL));
|
||||||
public NumberSetting scrollSens = addSetting(new NumberSetting(
|
public NumberSetting scrollSens = sgSpeed.add(new NumberSetting(
|
||||||
"sensibilidad del scroll", "sensibilidad de la rueda del ratón para modificar la velocidad, 0 para desactivar",
|
"sensibilidad del scroll", "sensibilidad de la rueda del ratón para modificar la velocidad, 0 para desactivar",
|
||||||
1, 0, 2, 0.1));
|
1, 0, 2, 0.1));
|
||||||
|
|
||||||
@@ -85,7 +87,7 @@ public class Freecam extends Module {
|
|||||||
fovScale = mc.options.getFovEffectScale().getValue();
|
fovScale = mc.options.getFovEffectScale().getValue();
|
||||||
viewBobbing = mc.options.getBobView().getValue();
|
viewBobbing = mc.options.getBobView().getValue();
|
||||||
|
|
||||||
if (staticView.isEnabled()) {
|
if (staticView.getValue()) {
|
||||||
mc.options.getFovEffectScale().setValue(0D);
|
mc.options.getFovEffectScale().setValue(0D);
|
||||||
mc.options.getBobView().setValue(false);
|
mc.options.getBobView().setValue(false);
|
||||||
}
|
}
|
||||||
@@ -117,25 +119,25 @@ public class Freecam extends Module {
|
|||||||
down = KeyUtil.isKeyDown(mc.options.sneakKey);
|
down = KeyUtil.isKeyDown(mc.options.sneakKey);
|
||||||
|
|
||||||
unpress();
|
unpress();
|
||||||
if (reloadChunks.isEnabled()) mc.worldRenderer.reload();
|
if (reloadChunks.getValue()) mc.worldRenderer.reload();
|
||||||
|
|
||||||
super.onEnable();
|
super.onEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (reloadChunks.isEnabled()) mc.execute(mc.worldRenderer::reload);
|
if (reloadChunks.getValue()) mc.execute(mc.worldRenderer::reload);
|
||||||
|
|
||||||
mc.options.setPerspective(perspective);
|
mc.options.setPerspective(perspective);
|
||||||
crouching = false;
|
crouching = false;
|
||||||
|
|
||||||
if (staticView.isEnabled()) {
|
if (staticView.getValue()) {
|
||||||
mc.options.getFovEffectScale().setValue(fovScale);
|
mc.options.getFovEffectScale().setValue(fovScale);
|
||||||
mc.options.getBobView().setValue(viewBobbing);
|
mc.options.getBobView().setValue(viewBobbing);
|
||||||
}
|
}
|
||||||
|
|
||||||
// para no flaggear el anticheat, cancelar cualquier acción dejada a medias estando en modo libre
|
// para no flaggear el anticheat, cancelar cualquier acción dejada a medias estando en modo libre
|
||||||
if (cancelActionPackets.isEnabled()) {
|
if (cancelActionPackets.getValue()) {
|
||||||
if (mc.interactionManager != null)
|
if (mc.interactionManager != null)
|
||||||
mc.interactionManager.cancelBlockBreaking();
|
mc.interactionManager.cancelBlockBreaking();
|
||||||
|
|
||||||
@@ -197,7 +199,7 @@ public class Freecam extends Module {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onSendPacket(PacketEvent.Send event) {
|
public void onSendPacket(PacketEvent.Send event) {
|
||||||
if (!isEnabled() || !cancelActionPackets.isEnabled()) return;
|
if (!isEnabled() || !cancelActionPackets.getValue()) return;
|
||||||
if (event.getStage() != Stage.PRE) return;
|
if (event.getStage() != Stage.PRE) return;
|
||||||
|
|
||||||
Packet<?> packet = event.getPacket();
|
Packet<?> packet = event.getPacket();
|
||||||
@@ -277,7 +279,7 @@ public class Freecam extends Module {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private void onMouseScroll(MouseScrollEvent event) {
|
private void onMouseScroll(MouseScrollEvent event) {
|
||||||
if (scrollSens.getValue() > 0 && mc.currentScreen == null && KeyUtil.isKeyDown(scrollKey.getKey())) {
|
if (scrollSens.getValue() > 0 && mc.currentScreen == null && KeyUtil.isKeyDown(scrollKey.getValue())) {
|
||||||
speed += event.getVertical() / 4 * (scrollSens.getValue() * speed);
|
speed += event.getVertical() / 4 * (scrollSens.getValue() * speed);
|
||||||
if (speed < 0.1) speed = 0.1;
|
if (speed < 0.1) speed = 0.1;
|
||||||
event.cancel();
|
event.cancel();
|
||||||
@@ -302,7 +304,7 @@ public class Freecam extends Module {
|
|||||||
if (mc.player.getId() == packet.playerId())
|
if (mc.player.getId() == packet.playerId())
|
||||||
toggle();
|
toggle();
|
||||||
} else if (event.getPacket() instanceof HealthUpdateS2CPacket packet) {
|
} else if (event.getPacket() instanceof HealthUpdateS2CPacket packet) {
|
||||||
if (mc.player.getHealth() - packet.getHealth() > 0 && toggleOnDamage.isEnabled()) {
|
if (mc.player.getHealth() - packet.getHealth() > 0 && toggleOnDamage.getValue()) {
|
||||||
ChatUtil.info("cámara libre se ha desactivado porque has recibido daño");
|
ChatUtil.info("cámara libre se ha desactivado porque has recibido daño");
|
||||||
toggle();
|
toggle();
|
||||||
}
|
}
|
||||||
@@ -322,22 +324,22 @@ public class Freecam extends Module {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBreakBlock(BreakBlockEvent event) {
|
public void onBreakBlock(BreakBlockEvent event) {
|
||||||
if (cancelActionPackets.isEnabled()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPlaceBlock(PlaceBlockEvent event) {
|
public void onPlaceBlock(PlaceBlockEvent event) {
|
||||||
if (cancelActionPackets.isEnabled()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onInteractEntity(InteractEntityEvent event) {
|
public void onInteractEntity(InteractEntityEvent event) {
|
||||||
if (cancelActionPackets.isEnabled()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onAttack(AttackEntityEvent event) {
|
public void onAttack(AttackEntityEvent event) {
|
||||||
if (cancelActionPackets.isEnabled()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeLookDirection(double deltaX, double deltaY) {
|
public void changeLookDirection(double deltaX, double deltaY) {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package me.retucio.sputnik.module.modules.camera;
|
|||||||
|
|
||||||
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.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.util.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import net.minecraft.client.option.Perspective;
|
import net.minecraft.client.option.Perspective;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
@@ -16,13 +16,13 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
|
|
||||||
public class Freelook extends Module {
|
public class Freelook extends Module {
|
||||||
|
|
||||||
public EnumSetting<CameraMode> mode = addSetting(new EnumSetting<>("cámara a mover", "elige cual cámara mover con el ratón y cuál se queda estática",
|
public EnumSetting<CameraMode> mode = sgGeneral.add(new EnumSetting<>("cámara a mover", "elige cual cámara mover con el ratón y cuál se queda estática",
|
||||||
CameraMode.class, CameraMode.CAMERA));
|
CameraMode.class, CameraMode.CAMERA));
|
||||||
|
|
||||||
public NumberSetting arrowSens = addSetting(new NumberSetting("sensibilidad de las flechas", "cuánto rotan la cámara estática las flechas (0 para desactivar)",
|
public NumberSetting arrowSens = sgGeneral.add(new NumberSetting("sensibilidad de las flechas", "cuánto rotan la cámara estática las flechas (0 para desactivar)",
|
||||||
4, 0, 10, 0.1));
|
4, 0, 10, 0.1));
|
||||||
|
|
||||||
public NumberSetting mouseSens = addSetting(new NumberSetting("sensibilidad del ratón", ".",
|
public NumberSetting mouseSens = sgGeneral.add(new NumberSetting("sensibilidad del ratón", ".",
|
||||||
0.1, 0, 2, 0.05));
|
0.1, 0, 2, 0.05));
|
||||||
|
|
||||||
private float yaw;
|
private float yaw;
|
||||||
@@ -39,7 +39,7 @@ public class Freelook extends Module {
|
|||||||
keyMode.setValue(KeyModes.HOLD);
|
keyMode.setValue(KeyModes.HOLD);
|
||||||
|
|
||||||
notify.setDefaultValue(false);
|
notify.setDefaultValue(false);
|
||||||
notify.setEnabled(false);
|
notify.setValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package me.retucio.sputnik.module.modules.camera;
|
|||||||
import me.retucio.sputnik.mixin.accessor.StatusEffectInstanceAccessor;
|
import me.retucio.sputnik.mixin.accessor.StatusEffectInstanceAccessor;
|
||||||
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.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
import me.retucio.sputnik.module.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
import net.minecraft.entity.effect.StatusEffects;
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
import net.minecraft.registry.Registries;
|
import net.minecraft.registry.Registries;
|
||||||
@@ -18,9 +18,9 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class Fullbright extends Module {
|
public class Fullbright extends Module {
|
||||||
|
|
||||||
public EnumSetting<Modes> mode = addSetting(new EnumSetting<>("modo", "qué modo de iluminación emplear (usar poción con shaders)", Modes.class, Modes.GAMMA));
|
public EnumSetting<Modes> mode = sgGeneral.add(new EnumSetting<>("modo", "qué modo de iluminación emplear (usar poción con shaders)", Modes.class, Modes.GAMMA));
|
||||||
|
|
||||||
public ColorSetting color = addSetting(new ColorSetting("filtro", "filtro de color", new Color(255, 255, 255, 255), false));
|
public ColorSetting color = sgGeneral.add(new ColorSetting("filtro", "filtro de color", new Color(255, 255, 255, 255), false));
|
||||||
|
|
||||||
public Fullbright() {
|
public Fullbright() {
|
||||||
super("brilli brilli",
|
super("brilli brilli",
|
||||||
|
|||||||
@@ -5,28 +5,35 @@ import me.retucio.sputnik.event.events.MouseScrollEvent;
|
|||||||
import me.retucio.sputnik.event.events.PerspectiveChangeEvent;
|
import me.retucio.sputnik.event.events.PerspectiveChangeEvent;
|
||||||
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.settings.*;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.util.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
// continúa en CameraMixin
|
// continúa en CameraMixin
|
||||||
public class PerspectivePlus extends Module {
|
public class PerspectivePlus extends Module {
|
||||||
|
|
||||||
private double distance;
|
|
||||||
|
|
||||||
// ajustes
|
// ajustes
|
||||||
public BooleanSetting clip = addSetting(new BooleanSetting(
|
|
||||||
|
SettingGroup sgScroll = addSg(new SettingGroup("scrolleo", true));
|
||||||
|
|
||||||
|
public BooleanSetting clip = sgGeneral.add(new BooleanSetting(
|
||||||
"clip", "atravesar bloques con la cámara", true));
|
"clip", "atravesar bloques con la cámara", true));
|
||||||
|
|
||||||
public NumberSetting defaultDistance = addSetting(new NumberSetting(
|
public NumberSetting defaultDistance = sgGeneral.add(new NumberSetting(
|
||||||
"distancia", "distancia a la que está la cámara del jugador por defecto",
|
"distancia", "distancia a la que está la cámara del jugador por defecto",
|
||||||
4, 1, 20, 0.2));
|
4, 1, 20, 0.2));
|
||||||
|
|
||||||
public NumberSetting scrollSens = addSetting(new NumberSetting(
|
public NumberSetting scrollSens = sgScroll.add(new NumberSetting(
|
||||||
"sensibilidad del scroll", "sensibilidad de la rueda del ratón (0 para desactivar)",
|
"sensibilidad del scroll", "sensibilidad de la rueda del ratón (0 para desactivar)",
|
||||||
1, 0, 8, 0.1));
|
1, 0, 8, 0.1));
|
||||||
|
|
||||||
public KeySetting scrollKey = addSetting(new KeySetting("tecla del scroll", "qué tecla mantener para usar la rueda del ratón", GLFW.GLFW_KEY_LEFT_ALT));
|
public KeySetting scrollKey = sgScroll.add(new KeySetting("tecla del scroll", "qué tecla mantener para usar la rueda del ratón",
|
||||||
|
GLFW.GLFW_KEY_LEFT_ALT));
|
||||||
|
|
||||||
|
private double distance;
|
||||||
|
|
||||||
public PerspectivePlus() {
|
public PerspectivePlus() {
|
||||||
super("perspectiva plus",
|
super("perspectiva plus",
|
||||||
@@ -50,7 +57,7 @@ public class PerspectivePlus extends Module {
|
|||||||
if (mc.options.getPerspective() == net.minecraft.client.option.Perspective.FIRST_PERSON
|
if (mc.options.getPerspective() == net.minecraft.client.option.Perspective.FIRST_PERSON
|
||||||
|| mc.currentScreen != null || scrollSens.getValue() <= 0) return;
|
|| mc.currentScreen != null || scrollSens.getValue() <= 0) return;
|
||||||
|
|
||||||
if (KeyUtil.isKeyDown(scrollKey.getKey())) {
|
if (KeyUtil.isKeyDown(scrollKey.getValue())) {
|
||||||
distance -= event.getVertical() / 4 * (scrollSens.getValue() * distance);
|
distance -= event.getVertical() / 4 * (scrollSens.getValue() * distance);
|
||||||
event.cancel();
|
event.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,17 @@ import me.retucio.sputnik.event.SubscribeEvent;
|
|||||||
import me.retucio.sputnik.event.events.ChangeRotationEvent;
|
import me.retucio.sputnik.event.events.ChangeRotationEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.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;
|
||||||
|
|
||||||
public class Rotations extends Module {
|
public class Rotations extends Module {
|
||||||
|
|
||||||
public NumberSetting yaw = addSetting(new NumberSetting("guiñada", "eje vertical - giro horizontal (yaw)", 0, -180, 180, 1));
|
public NumberSetting yaw = sgGeneral.add(new NumberSetting("guiñada", "eje vertical - giro horizontal (yaw)", 0, -180, 180, 1));
|
||||||
public NumberSetting pitch = addSetting(new NumberSetting("cabeceo", "eje horizontal - giro vertical (pitch)", 0, -90, 90, 1));
|
public NumberSetting pitch = sgGeneral.add(new NumberSetting("cabeceo", "eje horizontal - giro vertical (pitch)", 0, -90, 90, 1));
|
||||||
|
|
||||||
public BooleanSetting smooth = addSetting(new BooleanSetting("evitar movimiento", "cancela todo movimiento de la cámara", false));
|
public BooleanSetting smooth = sgGeneral.add(new BooleanSetting("evitar movimiento", "cancela todo movimiento de la cámara", false));
|
||||||
public BooleanSetting serverSide = addSetting(new BooleanSetting("serverside", "espamea paquetes de rotación al servidor", false));
|
public BooleanSetting serverSide = sgGeneral.add(new BooleanSetting("serverside", "espamea paquetes de rotación al servidor", false));
|
||||||
|
|
||||||
public Rotations() {
|
public Rotations() {
|
||||||
super("rotaciones",
|
super("rotaciones",
|
||||||
@@ -29,14 +29,14 @@ public class Rotations extends Module {
|
|||||||
mc.player.setYaw(yaw.getFloatValue());
|
mc.player.setYaw(yaw.getFloatValue());
|
||||||
mc.player.setPitch(pitch.getFloatValue());
|
mc.player.setPitch(pitch.getFloatValue());
|
||||||
|
|
||||||
if (serverSide.isEnabled())
|
if (serverSide.getValue())
|
||||||
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
|
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
|
||||||
yaw.getFloatValue(), pitch.getFloatValue(), mc.player.isOnGround(), mc.player.horizontalCollision));
|
yaw.getFloatValue(), pitch.getFloatValue(), mc.player.isOnGround(), mc.player.horizontalCollision));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onChangeRotation(ChangeRotationEvent event) {
|
public void onChangeRotation(ChangeRotationEvent event) {
|
||||||
if (smooth.isEnabled()
|
if (smooth.getValue()
|
||||||
&& (event.getYaw() != yaw.getFloatValue() || event.getPitch() != pitch.getFloatValue())){
|
&& (event.getYaw() != yaw.getFloatValue() || event.getPitch() != pitch.getFloatValue())){
|
||||||
event.cancel();
|
event.cancel();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -5,30 +5,34 @@ import me.retucio.sputnik.event.events.GetFOVEvent;
|
|||||||
import me.retucio.sputnik.event.events.MouseScrollEvent;
|
import me.retucio.sputnik.event.events.MouseScrollEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.util.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
// continúa en GameRendererMixin
|
// continúa en GameRendererMixin
|
||||||
public class Zoom extends Module {
|
public class Zoom extends Module {
|
||||||
|
|
||||||
public BooleanSetting showHands = addSetting(new BooleanSetting("mostrar manos", "esconde o muestra las manos al hacer zoom", true));
|
SettingGroup sgVisual = addSg(new SettingGroup("visual", true));
|
||||||
public BooleanSetting showHUD = addSetting(new BooleanSetting("mostrar HUD", "esconde o muestra los indicadores en pantalla", true));
|
SettingGroup sgScroll = addSg(new SettingGroup("scrolleo", true));
|
||||||
|
SettingGroup sgCam = addSg(new SettingGroup("cámara", true));
|
||||||
|
|
||||||
public NumberSetting scrollSens = addSetting(new NumberSetting("sensibilidad del scroll", "sensibilidad de la rueda del ratón (0 para desactivar)",
|
public NumberSetting defaultZoom = sgGeneral.add(new NumberSetting("zoom", "cantidad de zoom",
|
||||||
0.4, 0, 8, 0.1));
|
|
||||||
|
|
||||||
public KeySetting scrollKey = addSetting(new KeySetting("tecla del scroll", "qué tecla mantener para usar la rueda del ratón", GLFW.GLFW_KEY_LEFT_CONTROL));
|
|
||||||
|
|
||||||
public NumberSetting defaultZoom = addSetting(new NumberSetting("zoom", "cantidad de zoom",
|
|
||||||
6, 1, 10, 0.1));
|
6, 1, 10, 0.1));
|
||||||
|
|
||||||
public NumberSetting mouseSensMultiplier = addSetting(new NumberSetting("sensibilidad", "multiplicador de la sensibilidad del ratón",
|
public BooleanSetting showHands = sgVisual.add(new BooleanSetting("mostrar manos", "esconde o muestra las manos al hacer zoom", true));
|
||||||
0.4, 0, 1, 0.05));
|
public BooleanSetting showHUD = sgVisual.add(new BooleanSetting("mostrar HUD", "esconde o muestra los indicadores en pantalla", true));
|
||||||
|
|
||||||
public BooleanSetting smoothCam = addSetting(new BooleanSetting("cámara cinemática", "usa la cámara cinemática mientras hagas zoom", false));
|
public NumberSetting scrollSens = sgScroll.add(new NumberSetting("sensibilidad del scroll", "sensibilidad de la rueda del ratón (0 para desactivar)",
|
||||||
|
0.4, 0, 8, 0.1));
|
||||||
|
public KeySetting scrollKey = sgScroll.add(new KeySetting("tecla del scroll", "qué tecla mantener para usar la rueda del ratón",
|
||||||
|
GLFW.GLFW_KEY_LEFT_CONTROL));
|
||||||
|
|
||||||
|
public NumberSetting mouseSensMultiplier = sgCam.add(new NumberSetting("sensibilidad", "multiplicador de la sensibilidad del ratón",
|
||||||
|
0.4, 0, 1, 0.05));
|
||||||
|
public BooleanSetting smoothCam = sgCam.add(new BooleanSetting("cámara cinemática", "usa la cámara cinemática mientras hagas zoom", false));
|
||||||
|
|
||||||
private boolean prevSmoothCam;
|
private boolean prevSmoothCam;
|
||||||
private double prevMouseSens;
|
private double prevMouseSens;
|
||||||
@@ -46,7 +50,7 @@ public class Zoom extends Module {
|
|||||||
keyMode.setValue(KeyModes.HOLD);
|
keyMode.setValue(KeyModes.HOLD);
|
||||||
|
|
||||||
notify.setDefaultValue(false);
|
notify.setDefaultValue(false);
|
||||||
notify.setEnabled(false);
|
notify.setValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -57,7 +61,7 @@ public class Zoom extends Module {
|
|||||||
prevMouseSens = mc.options.getMouseSensitivity().getValue();
|
prevMouseSens = mc.options.getMouseSensitivity().getValue();
|
||||||
prevFov = mc.options.getFov().getValue();
|
prevFov = mc.options.getFov().getValue();
|
||||||
prevHUD = mc.options.hudHidden;
|
prevHUD = mc.options.hudHidden;
|
||||||
mc.options.hudHidden = !showHUD.isEnabled();
|
mc.options.hudHidden = !showHUD.getValue();
|
||||||
|
|
||||||
value = defaultZoom.getValue();
|
value = defaultZoom.getValue();
|
||||||
|
|
||||||
@@ -79,14 +83,14 @@ public class Zoom extends Module {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTick() {
|
public void onTick() {
|
||||||
mc.options.smoothCameraEnabled = smoothCam.isEnabled();
|
mc.options.smoothCameraEnabled = smoothCam.getValue();
|
||||||
if (!smoothCam.isEnabled())
|
if (!smoothCam.getValue())
|
||||||
mc.options.getMouseSensitivity().setValue(prevMouseSens * mouseSensMultiplier.getValue());
|
mc.options.getMouseSensitivity().setValue(prevMouseSens * mouseSensMultiplier.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private void onMouseScroll(MouseScrollEvent event) {
|
private void onMouseScroll(MouseScrollEvent event) {
|
||||||
boolean key = scrollKey.getKey() == GLFW.GLFW_KEY_UNKNOWN || KeyUtil.isKeyDown(scrollKey.getKey());
|
boolean key = scrollKey.getValue() == GLFW.GLFW_KEY_UNKNOWN || KeyUtil.isKeyDown(scrollKey.getValue());
|
||||||
if (isEnabled() && scrollSens.getValue() > 0 && key) {
|
if (isEnabled() && scrollSens.getValue() > 0 && key) {
|
||||||
value += event.getVertical() * 0.25 * (scrollSens.getValue() * value);
|
value += event.getVertical() * 0.25 * (scrollSens.getValue() * value);
|
||||||
if (value < 1) value = 1;
|
if (value < 1) value = 1;
|
||||||
|
|||||||
@@ -0,0 +1,235 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.client;
|
||||||
|
|
||||||
|
import dev.firstdark.rpc.DiscordRpc;
|
||||||
|
import dev.firstdark.rpc.enums.ActivityType;
|
||||||
|
import dev.firstdark.rpc.enums.ErrorCode;
|
||||||
|
import dev.firstdark.rpc.exceptions.UnsupportedOsType;
|
||||||
|
import dev.firstdark.rpc.handlers.RPCEventHandler;
|
||||||
|
import dev.firstdark.rpc.models.DiscordRichPresence;
|
||||||
|
import dev.firstdark.rpc.models.User;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.Setting;
|
||||||
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.StringSetting;
|
||||||
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
|
|
||||||
|
|
||||||
|
public class DiscordRPC extends Module {
|
||||||
|
|
||||||
|
SettingGroup sgImage = addSg(new SettingGroup("imágenes", false));
|
||||||
|
SettingGroup sgButton = addSg(new SettingGroup("botón", false));
|
||||||
|
|
||||||
|
|
||||||
|
// general
|
||||||
|
|
||||||
|
public StringSetting details = sgGeneral.add(new StringSetting(
|
||||||
|
"detalles", "título",
|
||||||
|
"usando el mod de putas de retucio",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting state = sgGeneral.add(new StringSetting(
|
||||||
|
"estado", "subtítulo",
|
||||||
|
"(se lo está pasando en grande)",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting startTimestamp = sgGeneral.add(new StringSetting(
|
||||||
|
"sello de tiempo", "sello de tiempo del comienzo de la actividad, siguiendo el unix epoch (dejar vacío para ahora)",
|
||||||
|
"",
|
||||||
|
20
|
||||||
|
));
|
||||||
|
|
||||||
|
public EnumSetting<ActivityTypes> activityType = sgGeneral.add(new EnumSetting<>(
|
||||||
|
"tipo de actividad", "qué tipo de actividad se está llevando a cabo",
|
||||||
|
ActivityTypes.class, ActivityTypes.PLAYING
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting appId = sgGeneral.add(new StringSetting(
|
||||||
|
"id del bot", "id del bot a usar (obtener de discord.dev)",
|
||||||
|
"1314254766150258729", 20
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// imágenes
|
||||||
|
|
||||||
|
public StringSetting largeImageKey = sgImage.add(new StringSetting(
|
||||||
|
"imagen grande", "clave de la imagen grande",
|
||||||
|
"pengiun",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting largeImageText = sgImage.add(new StringSetting(
|
||||||
|
"texto de la imagen grande", "texto mostrado junto a la imagen grande",
|
||||||
|
"pengüino",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting smallImageKey = sgImage.add(new StringSetting(
|
||||||
|
"imagen pequeña", "clave de la imagen pequeña",
|
||||||
|
"pengiun",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting smallImageText = sgImage.add(new StringSetting(
|
||||||
|
"texto de la imagen pequeña", "texto mostrado junto a la imagen pequeña",
|
||||||
|
"pengüino",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// botón
|
||||||
|
|
||||||
|
public StringSetting buttonText = sgButton.add(new StringSetting(
|
||||||
|
"texto del botón", "texto a mostrar en el botón",
|
||||||
|
"hola",
|
||||||
|
20
|
||||||
|
));
|
||||||
|
|
||||||
|
public StringSetting buttonUrl = sgButton.add(new StringSetting(
|
||||||
|
"url del botón", "rickroll en gran 26 :wilted_rose:",
|
||||||
|
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
||||||
|
20
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// crear el rpc
|
||||||
|
private boolean initialized;
|
||||||
|
DiscordRpc rpc = new DiscordRpc();
|
||||||
|
RPCEventHandler handler = new RPCEventHandler() {
|
||||||
|
@Override
|
||||||
|
public void ready(User user) {
|
||||||
|
rpc.updatePresence(getPresence());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disconnected(ErrorCode errorCode, String message) {
|
||||||
|
ChatUtil.warn("desconectado: " + errorCode + " - " + message);
|
||||||
|
toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void errored(ErrorCode errorCode, String message) {
|
||||||
|
ChatUtil.error("error: " + errorCode + " - " + message);
|
||||||
|
toggle();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public DiscordRPC() {
|
||||||
|
super("discordRPC",
|
||||||
|
"personaliza la actividad de tu perfil en dishkor",
|
||||||
|
Category.CLIENT);
|
||||||
|
|
||||||
|
rpc.setDebugMode(false);
|
||||||
|
|
||||||
|
for (Setting<?> s : getSettings()) {
|
||||||
|
s.onUpdate(v -> update());
|
||||||
|
}
|
||||||
|
|
||||||
|
appId.onUpdate(v -> reload());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
String token = appId.getValue();
|
||||||
|
if (token == null || token.trim().isEmpty()) {
|
||||||
|
ChatUtil.error("configura el token del bot primero");
|
||||||
|
toggle();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
rpc.init(token, handler, false);
|
||||||
|
initialized = true;
|
||||||
|
} catch (UnsupportedOsType e) {
|
||||||
|
ChatUtil.error("sistema operativo no soportado");
|
||||||
|
toggle();
|
||||||
|
} catch (Exception e) {
|
||||||
|
ChatUtil.error("error al inicializar rpc: " + e.getMessage());
|
||||||
|
toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
if (initialized) {
|
||||||
|
rpc.shutdown();
|
||||||
|
initialized = false;
|
||||||
|
}
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private DiscordRichPresence getPresence() {
|
||||||
|
return DiscordRichPresence.builder()
|
||||||
|
.details(details.getValue())
|
||||||
|
.state(state.getValue())
|
||||||
|
.largeImageKey(largeImageKey.getValue())
|
||||||
|
.largeImageText(largeImageText.getValue())
|
||||||
|
.smallImageKey(smallImageKey.getValue())
|
||||||
|
.smallImageText(smallImageText.getValue())
|
||||||
|
.startTimestamp(getTimestamp())
|
||||||
|
.activityType(activityType.getValue().getActivityType())
|
||||||
|
.button(DiscordRichPresence.RPCButton.of(
|
||||||
|
buttonText.getValue(),
|
||||||
|
buttonUrl.getValue())
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
if (initialized && isEnabled()) {
|
||||||
|
try {
|
||||||
|
rpc.updatePresence(getPresence());
|
||||||
|
} catch (Exception e) {
|
||||||
|
ChatUtil.error("error al actualizar rpc: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
if (initialized && isEnabled()) {
|
||||||
|
rpc.shutdown();
|
||||||
|
try {
|
||||||
|
rpc.init(appId.getValue(), handler, false);
|
||||||
|
} catch (UnsupportedOsType e) {
|
||||||
|
ChatUtil.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getTimestamp() {
|
||||||
|
long timestamp;
|
||||||
|
if (startTimestamp.getValue().trim().isEmpty()) {
|
||||||
|
timestamp = System.currentTimeMillis();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
timestamp = Long.parseLong(startTimestamp.getValue());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
ChatUtil.error("introduce un NÚMERO (o déjalo vacío)");
|
||||||
|
timestamp = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return timestamp / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ActivityTypes {
|
||||||
|
PLAYING("jugando"),
|
||||||
|
STREAMING("streameando"),
|
||||||
|
LISTENING("escuchando"),
|
||||||
|
WATCHING("viendo"),
|
||||||
|
CUSTOM("custom"),
|
||||||
|
COMPETING("compitiendo");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
ActivityTypes(String name) { this.name = name; }
|
||||||
|
@Override public String toString() { return name; }
|
||||||
|
private ActivityType getActivityType() { return ActivityType.values()[ordinal()]; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package me.retucio.sputnik.module.modules.client;
|
package me.retucio.sputnik.module.modules.client;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.command.CommandManager;
|
import me.retucio.sputnik.command.CommandManager;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.TickEvent;
|
import me.retucio.sputnik.event.events.TickEvent;
|
||||||
@@ -9,10 +10,11 @@ import me.retucio.sputnik.module.Category;
|
|||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
import me.retucio.sputnik.module.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
import me.retucio.sputnik.module.settings.StringSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.StringSetting;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import me.retucio.sputnik.util.Colors;
|
import me.retucio.sputnik.util.Colors;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
@@ -22,25 +24,81 @@ 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 de la interfaz (y del cliente en general)
|
||||||
public class GUI extends Module {
|
public class GUI extends Module {
|
||||||
|
|
||||||
public ColorSetting color = addSetting(new ColorSetting("color", "color principal de la interfaz y el mod",
|
SettingGroup sgWidgets = addSg(new SettingGroup("widgets", true));
|
||||||
new Color(70, 20, 210, 230), false));
|
SettingGroup sgUi = addSg(new SettingGroup("interfaz", true));
|
||||||
|
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
|
||||||
|
));
|
||||||
|
|
||||||
// números negativos para deslizamiento inverso, 0 para desactivar
|
// números negativos para deslizamiento inverso, 0 para desactivar
|
||||||
public NumberSetting scrollSens = addSetting(new NumberSetting("sensibilidad del scroll", "qué tan sensible es la interfaz a la rueda del ratón",
|
public NumberSetting scrollSens = sgWidgets.add(new NumberSetting(
|
||||||
5, -15, 15, 0.5));
|
"sensibilidad del scroll",
|
||||||
public BooleanSetting scrollBar = addSetting(new BooleanSetting("barra de desplazamiento", "renderizar una barra de desplazamiento a la derecha de la interfaz", true));
|
"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 = addSetting(new BooleanSetting("barra de búsqueda", "renderizar una barra de búsqueda que filtra resultados en todos los marcos abiertos", true));
|
public BooleanSetting searchBar = sgWidgets.add(new BooleanSetting(
|
||||||
public BooleanSetting matchCase = addSetting(new BooleanSetting("distinguir mayúsculas", "la búsqueda es sensible a mayúsculas y minúsculas", false));
|
"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
|
// ^^^ no sé de qué sirve porque está todo en minúsculas pero bueno
|
||||||
|
|
||||||
public BooleanSetting blur = addSetting(new BooleanSetting("desenfoque", "desenfocar el fondo mientras la interfaz está abierta", true));
|
public BooleanSetting blur = sgUi.add(new BooleanSetting(
|
||||||
public StringSetting watermark = addSetting(new StringSetting("marca de agua", "marca de agua para interfaces (dejar vacío para desactivar)", me.retucio.sputnik.Sputnik.getVersionName(), 40));
|
"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 = addSetting(new StringSetting("prefijo", "prefijo de los comandos", "$", 10));
|
public StringSetting commandPrefix = sgChat.add(new StringSetting(
|
||||||
public StringSetting chatName = addSetting(new StringSetting("nombre", "qué nombre usar en notificaciones por el chat", "smegma", 20));
|
"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 = addSetting(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() {
|
public GUI() {
|
||||||
super("interfaz",
|
super("interfaz",
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package me.retucio.sputnik.module.modules.client;
|
|||||||
|
|
||||||
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.settings.*;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.*;
|
||||||
import me.retucio.sputnik.ui.hud.HudElement;
|
import me.retucio.sputnik.ui.hud.HudElement;
|
||||||
import me.retucio.sputnik.ui.hud.HudRenderer;
|
import me.retucio.sputnik.ui.hud.HudRenderer;
|
||||||
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
||||||
@@ -19,22 +20,97 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class HUD extends Module {
|
public class HUD extends Module {
|
||||||
|
|
||||||
|
SettingGroup sgEditor = addSg(new SettingGroup("editor", true));
|
||||||
|
SettingGroup sgDisplay = addSg(new SettingGroup("visualización", true));
|
||||||
|
SettingGroup sgElements = addSg(new SettingGroup("elementos", false));
|
||||||
|
|
||||||
// editor
|
// editor
|
||||||
public KeySetting editorKey = addSetting(new KeySetting("tecla del editor", "tecla asignada al editor de elementos del hud", GLFW.GLFW_KEY_PAGE_UP));
|
public KeySetting editorKey = sgEditor.add(new KeySetting(
|
||||||
|
"tecla del editor",
|
||||||
|
"tecla asignada al editor de elementos del hud",
|
||||||
|
GLFW.GLFW_KEY_PAGE_UP
|
||||||
|
));
|
||||||
|
public BooleanSetting axialMovement = sgEditor.add(new BooleanSetting(
|
||||||
|
"movimiento axial",
|
||||||
|
"te permite mover los elementos sobre los ejes más fácilmente",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
public NumberSetting axisOffset = sgEditor.add(new NumberSetting(
|
||||||
|
"offset de los ejes",
|
||||||
|
"offset a tener en cuenta al usar el movimiento axial",
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
50,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
public BooleanSetting arrowMovement = sgEditor.add(new BooleanSetting(
|
||||||
|
"movimiento con flechas",
|
||||||
|
"te permite mover el elemento seleccionado con las teclas de las flechas",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
public NumberSetting arrowOffset = sgEditor.add(new NumberSetting(
|
||||||
|
"cuánto mover con las flechas",
|
||||||
|
"cuántos píxeles mover el elemento seleccionado al usar las flechas",
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
20,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
// ajustes
|
// renderizado
|
||||||
public ColorSetting color = addSetting(new ColorSetting("color", "color del texto de los elementos del HUD",
|
public ColorSetting color = sgDisplay.add(new ColorSetting(
|
||||||
new Color(255, 255, 255, 255), false));
|
"color",
|
||||||
public BooleanSetting showOnF3 = addSetting(new BooleanSetting("mostrar en F3", "renderizar HUD en el menú de debug", false));
|
"color del texto de los elementos del HUD",
|
||||||
public BooleanSetting showOnChat = addSetting(new BooleanSetting("mostrar en chat", "renderizar HUD en la pantalla del chat", false));
|
new Color(255, 255, 255, 255), false)
|
||||||
|
);
|
||||||
|
public BooleanSetting shadow = sgDisplay.add(new BooleanSetting(
|
||||||
|
"sombra",
|
||||||
|
"texto con sombra",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
public BooleanSetting showOnF3 = sgDisplay.add(new BooleanSetting(
|
||||||
|
"mostrar en F3",
|
||||||
|
"renderizar HUD en el menú de debug",
|
||||||
|
false
|
||||||
|
));
|
||||||
|
public BooleanSetting showOnChat = sgDisplay.add(new BooleanSetting(
|
||||||
|
"mostrar en chat",
|
||||||
|
"renderizar HUD en la pantalla del chat",
|
||||||
|
false
|
||||||
|
));
|
||||||
|
|
||||||
public BooleanSetting shadow = addSetting(new BooleanSetting("sombra", "texto con sombra", true));
|
// elementos
|
||||||
public NumberSetting timezone = addSetting(new NumberSetting("zona horaria", "zona horaria en UTC+n", 1, -6, 6, 1));
|
public NumberSetting timezone = sgElements.add(new NumberSetting(
|
||||||
public EnumSetting<TimeFormat> timeFormat = addSetting(new EnumSetting<>("formato de la hora", "12h o 24h", TimeFormat.class, TimeFormat.TWENTY_FOUR_HOUR));
|
"zona horaria",
|
||||||
public StringSetting customText = addSetting(new StringSetting("texto custom", "marca de agua (dejar vacío para quitar)", "adolf jitler inshtagram feishbuc twiter", 40));
|
"zona horaria en UTC+n",
|
||||||
public EnumSetting<CoordsMode> coordsMode = addSetting(new EnumSetting<>("modo de coordenadas", "qué coordenadas mostrar", CoordsMode.class, CoordsMode.OVERWORLD));
|
1,
|
||||||
public EnumSetting<Dynosaurs> dyno = addSetting(new EnumSetting<>("dinosaurio", "qué dinosaurio mostrar",
|
-6,
|
||||||
Dynosaurs.class, Dynosaurs.SPINOSAURUS));
|
6,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
public EnumSetting<TimeFormat> timeFormat = sgElements.add(new EnumSetting<>(
|
||||||
|
"formato de la hora",
|
||||||
|
"12h o 24h",
|
||||||
|
TimeFormat.class,
|
||||||
|
TimeFormat.TWENTY_FOUR_HOUR
|
||||||
|
));
|
||||||
|
public StringSetting customText = sgElements.add(new StringSetting(
|
||||||
|
"texto custom",
|
||||||
|
"marca de agua (dejar vacío para quitar)",
|
||||||
|
"adolf jitler inshtagram feishbuc twiter",
|
||||||
|
40
|
||||||
|
));
|
||||||
|
public EnumSetting<CoordsMode> coordsMode = sgElements.add(new EnumSetting<>(
|
||||||
|
"modo de coordenadas",
|
||||||
|
"qué coordenadas mostrar",
|
||||||
|
CoordsMode.class,
|
||||||
|
CoordsMode.OVERWORLD
|
||||||
|
));
|
||||||
|
public EnumSetting<Dynosaurs> dyno = sgElements.add(new EnumSetting<>(
|
||||||
|
"dinosaurio",
|
||||||
|
"qué dinosaurio mostrar",
|
||||||
|
Dynosaurs.class, Dynosaurs.SPINOSAURUS
|
||||||
|
));
|
||||||
|
|
||||||
public HUD() {
|
public HUD() {
|
||||||
super("HUD",
|
super("HUD",
|
||||||
@@ -43,6 +119,9 @@ 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();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package me.retucio.sputnik.module.modules.misc;
|
|||||||
import me.retucio.sputnik.mixin.accessor.AnvilScreenAccessor;
|
import me.retucio.sputnik.mixin.accessor.AnvilScreenAccessor;
|
||||||
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.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
|
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
|
||||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class AnvilFont extends Module {
|
public class AnvilFont extends Module {
|
||||||
|
|
||||||
public EnumSetting<FontMode> fontMode = addSetting(new EnumSetting<>("tipografía", "qué tipografía utilizar",
|
public EnumSetting<FontMode> fontMode = sgGeneral.add(new EnumSetting<>("tipografía", "qué tipografía utilizar",
|
||||||
FontMode.class, FontMode.NORMAL));
|
FontMode.class, FontMode.NORMAL));
|
||||||
|
|
||||||
String text;
|
String text;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import me.retucio.sputnik.event.events.RenderBossbarEvent;
|
|||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
@@ -15,10 +15,25 @@ import java.util.WeakHashMap;
|
|||||||
|
|
||||||
public class BossbarStack extends Module {
|
public class BossbarStack extends Module {
|
||||||
|
|
||||||
public BooleanSetting stackBars = addSetting(new BooleanSetting("apilar barras", "apilar las bossbars", true));
|
public BooleanSetting stackBars = sgGeneral.add(new BooleanSetting(
|
||||||
public BooleanSetting hideNames = addSetting(new BooleanSetting("esconder nombres", "no renderiza el nombre de los bosses", false));
|
"apilar barras", "apilar las bossbars",
|
||||||
public NumberSetting spaceReduction = addSetting(new NumberSetting("reducción de espacio", "cuánto reducir el espacio entre bossbars",
|
true
|
||||||
0, 0, 10, 0.1));
|
));
|
||||||
|
|
||||||
|
public BooleanSetting hideNames = sgGeneral.add(new BooleanSetting(
|
||||||
|
"esconder nombres", "no renderiza el nombre de los bosses",
|
||||||
|
false
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting spaceReduction = sgGeneral.add(new NumberSetting(
|
||||||
|
"reducción de espacio",
|
||||||
|
"cuánto reducir el espacio entre bossbars",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
10,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
private final Map<ClientBossBar, Integer> bossBarMap = new WeakHashMap<>();
|
private final Map<ClientBossBar, Integer> bossBarMap = new WeakHashMap<>();
|
||||||
|
|
||||||
@@ -30,16 +45,16 @@ public class BossbarStack extends Module {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private void onRenderBossText(RenderBossbarEvent.BossText event) {
|
private void onRenderBossText(RenderBossbarEvent.BossText event) {
|
||||||
if (hideNames.isEnabled()) {
|
if (hideNames.getValue()) {
|
||||||
event.setName(Text.empty());
|
event.setName(Text.empty());
|
||||||
return;
|
return;
|
||||||
} else if (bossBarMap.isEmpty() || !stackBars.isEnabled()) return;
|
} else if (bossBarMap.isEmpty() || !stackBars.getValue()) return;
|
||||||
|
|
||||||
ClientBossBar bar = event.getBossBar();
|
ClientBossBar bar = event.getBossBar();
|
||||||
Integer amount = bossBarMap.get(bar);
|
Integer amount = bossBarMap.get(bar);
|
||||||
bossBarMap.remove(bar);
|
bossBarMap.remove(bar);
|
||||||
|
|
||||||
if (amount != null && !hideNames.isEnabled())
|
if (amount != null && !hideNames.getValue())
|
||||||
event.setName(event.getName().copy().append(" x" + amount));
|
event.setName(event.getName().copy().append(" x" + amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +65,7 @@ public class BossbarStack extends Module {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private void onRenderBossBars(RenderBossbarEvent.BossIterator event) {
|
private void onRenderBossBars(RenderBossbarEvent.BossIterator event) {
|
||||||
if (stackBars.isEnabled()) {
|
if (stackBars.getValue()) {
|
||||||
HashMap<String, ClientBossBar> chosenBarMap = new HashMap<>();
|
HashMap<String, ClientBossBar> chosenBarMap = new HashMap<>();
|
||||||
event.getIterator().forEachRemaining(bar -> {
|
event.getIterator().forEachRemaining(bar -> {
|
||||||
String name = bar.getName().getString();
|
String name = bar.getName().getString();
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ import me.retucio.sputnik.event.events.ReceiveMessageEvent;
|
|||||||
import me.retucio.sputnik.event.events.SendMessageEvent;
|
import me.retucio.sputnik.event.events.SendMessageEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
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.interfaces.IChatHudLine;
|
import me.retucio.sputnik.util.interfaces.IChatHudLine;
|
||||||
import me.retucio.sputnik.util.interfaces.IChatHudLineVisible;
|
import me.retucio.sputnik.util.interfaces.IChatHudLineVisible;
|
||||||
@@ -43,15 +44,17 @@ import java.util.regex.Pattern;
|
|||||||
public class ChatPlus extends Module {
|
public class ChatPlus extends Module {
|
||||||
|
|
||||||
// ajustes
|
// ajustes
|
||||||
public BooleanSetting timestamps = addSetting(new BooleanSetting("sello de tiempo", "muestra a qué hora se ha enviado un mensaje", true));
|
SettingGroup sgChat = addSg(new SettingGroup("funcionamiento del chat", true));
|
||||||
public BooleanSetting timestampSecs = addSetting(new BooleanSetting("mostrar segundos", "muestra segundos también en el sello de tiempo", false));
|
|
||||||
public BooleanSetting showHeads = addSetting(new BooleanSetting("cabezas", "muestra la cabeza del jugador junto a su mensaje", true));
|
|
||||||
public BooleanSetting coordsProtection = addSetting(new BooleanSetting("proteger coordenadas", "evitar enviar coordenadas por el chat", true));
|
|
||||||
|
|
||||||
public BooleanSetting keepHistory = addSetting(new BooleanSetting("no borrar chat", "no borrar el chat tras desconectarse", true));
|
public BooleanSetting timestamps = sgGeneral.add(new BooleanSetting("sello de tiempo", "muestra a qué hora se ha enviado un mensaje", true));
|
||||||
public BooleanSetting logger = addSetting(new BooleanSetting("registro", "evita que se borre el chat de un server", true));
|
public BooleanSetting timestampSecs = sgGeneral.add(new BooleanSetting("mostrar segundos", "muestra segundos también en el sello de tiempo", false));
|
||||||
public BooleanSetting noCharLimit = addSetting(new BooleanSetting("quitar límite de caracteres", "te deja escribir mensajes tan largos como desees", false));
|
public BooleanSetting showHeads = sgGeneral.add(new BooleanSetting("cabezas", "muestra la cabeza del jugador junto a su mensaje", true));
|
||||||
public NumberSetting chatHistoryExtraLength = addSetting(new NumberSetting("expandir chat", "cuántas líneas añadir al historial del chat",
|
|
||||||
|
public BooleanSetting coordsProtection = sgChat.add(new BooleanSetting("proteger coordenadas", "evitar enviar coordenadas por el chat", true));
|
||||||
|
public BooleanSetting keepHistory = sgChat.add(new BooleanSetting("no borrar chat", "no borrar el chat tras desconectarse", true));
|
||||||
|
public BooleanSetting logger = sgChat.add(new BooleanSetting("registro", "evita que se borre el chat de un server", true));
|
||||||
|
public BooleanSetting noCharLimit = sgChat.add(new BooleanSetting("quitar límite de caracteres", "te deja escribir mensajes tan largos como desees", false));
|
||||||
|
public NumberSetting chatHistoryExtraLength = sgChat.add(new NumberSetting("expandir chat", "cuántas líneas añadir al historial del chat",
|
||||||
0, 0, 1000, 1));
|
0, 0, 1000, 1));
|
||||||
|
|
||||||
public ChatPlus() {
|
public ChatPlus() {
|
||||||
@@ -79,7 +82,7 @@ public class ChatPlus extends Module {
|
|||||||
Text message = event.getMessage();
|
Text message = event.getMessage();
|
||||||
|
|
||||||
// registrar mensajes para evitar su eliminación
|
// registrar mensajes para evitar su eliminación
|
||||||
if (logger.isEnabled()) {
|
if (logger.getValue()) {
|
||||||
String messageString = message.getString();
|
String messageString = message.getString();
|
||||||
if (loggerRegex.matcher(messageString).find()) {
|
if (loggerRegex.matcher(messageString).find()) {
|
||||||
MutableText newMessage = Text.empty();
|
MutableText newMessage = Text.empty();
|
||||||
@@ -97,7 +100,7 @@ public class ChatPlus extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// agregar sellos de tiempo a los mensajes
|
// agregar sellos de tiempo a los mensajes
|
||||||
if (timestamps.isEnabled()) {
|
if (timestamps.getValue()) {
|
||||||
Text timestamp = Text.literal("[" + dateFormat.format(new Date()) + "] ").formatted(Formatting.GRAY);
|
Text timestamp = Text.literal("[" + dateFormat.format(new Date()) + "] ").formatted(Formatting.GRAY);
|
||||||
message = Text.empty().append(timestamp).append(message);
|
message = Text.empty().append(timestamp).append(message);
|
||||||
}
|
}
|
||||||
@@ -109,7 +112,7 @@ public class ChatPlus extends Module {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
private void onSendMessage(SendMessageEvent event) {
|
private void onSendMessage(SendMessageEvent event) {
|
||||||
// evitar mandar coordenadas por el chat
|
// evitar mandar coordenadas por el chat
|
||||||
if (coordsProtection.isEnabled() && containsCoordinates(event.getMessage())) {
|
if (coordsProtection.getValue() && containsCoordinates(event.getMessage())) {
|
||||||
ChatUtil.warn(Text.literal("cuidadito con las coordenadas chavalín").append(
|
ChatUtil.warn(Text.literal("cuidadito con las coordenadas chavalín").append(
|
||||||
getSendButton(event.getMessage())));
|
getSendButton(event.getMessage())));
|
||||||
|
|
||||||
@@ -124,7 +127,7 @@ public class ChatPlus extends Module {
|
|||||||
|
|
||||||
@SuppressWarnings("DataFlowIssue")
|
@SuppressWarnings("DataFlowIssue")
|
||||||
public void beforeDrawMessage(DrawContext context, ChatHudLine.Visible line, int y, int color) {
|
public void beforeDrawMessage(DrawContext context, ChatHudLine.Visible line, int y, int color) {
|
||||||
if (!isEnabled() || !showHeads.isEnabled()) return;
|
if (!isEnabled() || !showHeads.getValue()) return;
|
||||||
|
|
||||||
// dibujar la cabeza al principio del mensaje
|
// dibujar la cabeza al principio del mensaje
|
||||||
if (((IChatHudLineVisible) (Object) line).sputnik$isStartOfEntry())
|
if (((IChatHudLineVisible) (Object) line).sputnik$isStartOfEntry())
|
||||||
@@ -136,7 +139,7 @@ public class ChatPlus extends Module {
|
|||||||
|
|
||||||
public void afterDrawMessage(DrawContext context) {
|
public void afterDrawMessage(DrawContext context) {
|
||||||
// finalizar renderizado de la cabeza
|
// finalizar renderizado de la cabeza
|
||||||
if (!isEnabled() || !showHeads.isEnabled()) return;
|
if (!isEnabled() || !showHeads.getValue()) return;
|
||||||
context.getMatrices().popMatrix();
|
context.getMatrices().popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +218,7 @@ public class ChatPlus extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateDateFormat() {
|
private void updateDateFormat() {
|
||||||
dateFormat = new SimpleDateFormat(timestampSecs.isEnabled() ? "HH:mm:ss" : "HH:mm");
|
dateFormat = new SimpleDateFormat(timestampSecs.getValue() ? "HH:mm:ss" : "HH:mm");
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean containsCoordinates(String message) {
|
private boolean containsCoordinates(String message) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package me.retucio.sputnik.module.modules.misc;
|
|||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
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.settings.StringSetting;
|
import me.retucio.sputnik.module.setting.settings.StringSetting;
|
||||||
import net.minecraft.client.network.OtherClientPlayerEntity;
|
import net.minecraft.client.network.OtherClientPlayerEntity;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
@@ -12,7 +12,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class FakePlayer extends Module {
|
public class FakePlayer extends Module {
|
||||||
|
|
||||||
public StringSetting name = addSetting(new StringSetting("nombre", "qué nombre asignarle al jugador", "apio boy", 22));
|
public StringSetting name = sgGeneral.add(new StringSetting("nombre", "qué nombre asignarle al jugador", "apio boy", 22));
|
||||||
|
|
||||||
private OtherClientPlayerEntity player = null;
|
private OtherClientPlayerEntity player = null;
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import me.retucio.sputnik.command.CommandManager;
|
|||||||
import me.retucio.sputnik.event.events.ClientClickEvent;
|
import me.retucio.sputnik.event.events.ClientClickEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import net.minecraft.client.texture.NativeImage;
|
import net.minecraft.client.texture.NativeImage;
|
||||||
import net.minecraft.text.ClickEvent;
|
import net.minecraft.text.ClickEvent;
|
||||||
@@ -30,14 +31,16 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class ScreenshotPlus extends Module {
|
public class ScreenshotPlus extends Module {
|
||||||
|
|
||||||
public BooleanSetting saveButton = addSetting(new BooleanSetting("botón de guardar", "mostrar botón para guardar la captura localmente", true));
|
SettingGroup sgButtons = addSg(new SettingGroup("botones", true));
|
||||||
public BooleanSetting copyButton = addSetting(new BooleanSetting("botón de copiar", "mostrar botón para copiar la captura al portapapeles", true));
|
|
||||||
public BooleanSetting openButton = addSetting(new BooleanSetting("botón de abrir", "mostrar botón para abrir el archivo de la captura", true));
|
|
||||||
public BooleanSetting discardButton = addSetting(new BooleanSetting("botón de descartar", "mostrar botón para descartar la captura", true));
|
|
||||||
|
|
||||||
public EnumSetting<ScreenshotActions> defaultAction = addSetting(new EnumSetting<>("por defecto", "qué acción tomar por defecto",
|
public EnumSetting<ScreenshotActions> defaultAction = sgGeneral.add(new EnumSetting<>("por defecto", "qué acción tomar por defecto",
|
||||||
ScreenshotActions.class, ScreenshotActions.NONE));
|
ScreenshotActions.class, ScreenshotActions.NONE));
|
||||||
|
|
||||||
|
public BooleanSetting saveButton = sgButtons.add(new BooleanSetting("botón de guardar", "mostrar botón para guardar la captura localmente", true));
|
||||||
|
public BooleanSetting copyButton = sgButtons.add(new BooleanSetting("botón de copiar", "mostrar botón para copiar la captura al portapapeles", true));
|
||||||
|
public BooleanSetting openButton = sgButtons.add(new BooleanSetting("botón de abrir", "mostrar botón para abrir el archivo de la captura", true));
|
||||||
|
public BooleanSetting discardButton = sgButtons.add(new BooleanSetting("botón de descartar", "mostrar botón para descartar la captura", true));
|
||||||
|
|
||||||
private NativeImage screenshot;
|
private NativeImage screenshot;
|
||||||
private File screenshotFile;
|
private File screenshotFile;
|
||||||
|
|
||||||
@@ -49,10 +52,10 @@ public class ScreenshotPlus extends Module {
|
|||||||
|
|
||||||
public void sendScreenshotMessage() {
|
public void sendScreenshotMessage() {
|
||||||
MutableText baseText = Text.literal("captura de pantalla tomada\n");
|
MutableText baseText = Text.literal("captura de pantalla tomada\n");
|
||||||
if (saveButton.isEnabled() && !defaultAction.is(ScreenshotActions.SAVE)) baseText.append(getSaveButton().append(" "));
|
if (saveButton.getValue() && !defaultAction.is(ScreenshotActions.SAVE)) baseText.append(getSaveButton().append(" "));
|
||||||
if (copyButton.isEnabled()) baseText.append(getCopyButton().append(" "));
|
if (copyButton.getValue()) baseText.append(getCopyButton().append(" "));
|
||||||
if (openButton.isEnabled() && defaultAction.is(ScreenshotActions.SAVE)) baseText.append(getOpenButton().append(" "));
|
if (openButton.getValue() && defaultAction.is(ScreenshotActions.SAVE)) baseText.append(getOpenButton().append(" "));
|
||||||
if (discardButton.isEnabled() && !defaultAction.is(ScreenshotActions.NONE)) baseText.append(getDiscardButton().append(" "));
|
if (discardButton.getValue() && !defaultAction.is(ScreenshotActions.NONE)) baseText.append(getDiscardButton().append(" "));
|
||||||
ChatUtil.info(baseText);
|
ChatUtil.info(baseText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import me.retucio.sputnik.event.events.KeyEvent;
|
|||||||
import me.retucio.sputnik.mixin.accessor.HandledScreenAccessor;
|
import me.retucio.sputnik.mixin.accessor.HandledScreenAccessor;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import me.retucio.sputnik.util.Colors;
|
import me.retucio.sputnik.util.Colors;
|
||||||
@@ -29,8 +29,8 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
public class ShulkerPeek extends Module {
|
public class ShulkerPeek extends Module {
|
||||||
|
|
||||||
public KeySetting previewKey = addSetting(new KeySetting("tecla de previsualización", "tecla a mantener para previsualizar", GLFW.GLFW_KEY_LEFT_ALT));
|
public KeySetting previewKey = sgGeneral.add(new KeySetting("tecla de previsualización", "tecla a mantener para previsualizar", GLFW.GLFW_KEY_LEFT_ALT));
|
||||||
public BooleanSetting showTooltips = addSetting(new BooleanSetting("mostrar tooltips", "añadir texto a los tooltips (cajas de texto) de los shulkers", true));
|
public BooleanSetting showTooltips = sgGeneral.add(new BooleanSetting("mostrar tooltips", "añadir texto a los tooltips (cajas de texto) de los shulkers", true));
|
||||||
|
|
||||||
public static final HashMap<Item, Color> SHULKER_COLORS = new HashMap<>();
|
public static final HashMap<Item, Color> SHULKER_COLORS = new HashMap<>();
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ public class ShulkerPeek extends Module {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onKey(KeyEvent event) {
|
public void onKey(KeyEvent event) {
|
||||||
if (mc.player == null) return;
|
if (mc.player == null) return;
|
||||||
if (event.getKey() != previewKey.getKey()) return;
|
if (event.getKey() != previewKey.getValue()) return;
|
||||||
|
|
||||||
if (event.getAction() == GLFW.GLFW_PRESS) {
|
if (event.getAction() == GLFW.GLFW_PRESS) {
|
||||||
openPreviewScreen();
|
openPreviewScreen();
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.misc;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
|
||||||
|
public class UnfocusedCpu extends Module {
|
||||||
|
|
||||||
|
public UnfocusedCpu() {
|
||||||
|
super("aliviar cpu", "evita renderizar objetos en pantalla si la ventana no está seleccionada", Category.MISC);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.Subscribe;
|
||||||
|
import me.retucio.sputnik.event.BoatMoveEvent;
|
||||||
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
|
import me.retucio.sputnik.event.events.PacketEvent;
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import net.minecraft.network.packet.s2c.play.VehicleMoveS2CPacket;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public class BoatFly extends Module {
|
||||||
|
|
||||||
|
public NumberSetting speed = sgGeneral.add(new NumberSetting(
|
||||||
|
"velocidad horizontal",
|
||||||
|
"velocidad a la que moverse horizontalmente",
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
5,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting vSpeed = sgGeneral.add(new NumberSetting(
|
||||||
|
"velocidad vertical",
|
||||||
|
"velocidad a la que moverse verticalmente",
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
5,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting stepHeight = sgGeneral.add(new NumberSetting(
|
||||||
|
"altura de escalonado",
|
||||||
|
"como escalones pero pal barco",
|
||||||
|
0.5,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting cancelPackets = sgGeneral.add(new BooleanSetting(
|
||||||
|
"cancelar paquetes",
|
||||||
|
"cancelar paquetes de movimiento del barco enviados por el servidor",
|
||||||
|
false
|
||||||
|
));
|
||||||
|
|
||||||
|
public BoatFly() {
|
||||||
|
super("barco volador", "convierte tu bote de acacia en un Lockheed F-117 Nighthawk", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
private void onBoatMove(BoatMoveEvent event) {
|
||||||
|
if (event.getBoat().getControllingPassenger() != mc.player) return;
|
||||||
|
event.getBoat().setYaw(mc.player.getYaw());
|
||||||
|
|
||||||
|
float yaw = event.getBoat().getYaw();
|
||||||
|
int dx = 0, dy = 0, dz = 0;
|
||||||
|
|
||||||
|
if (mc.options.rightKey.isPressed()) dx++;
|
||||||
|
if (mc.options.leftKey.isPressed()) dx--;
|
||||||
|
|
||||||
|
if (mc.options.jumpKey.isPressed()) dy++;
|
||||||
|
if (mc.options.sprintKey.isPressed()) dy--;
|
||||||
|
// ctrl para bajar, en vez de shift, porque si no te desmontas
|
||||||
|
|
||||||
|
if (mc.options.backKey.isPressed()) dz++;
|
||||||
|
if (mc.options.forwardKey.isPressed()) dz--;
|
||||||
|
|
||||||
|
double speed = this.speed.getValue();
|
||||||
|
double sin = Math.sin(Math.toRadians(yaw));
|
||||||
|
double cos = Math.cos(Math.toRadians(yaw));
|
||||||
|
|
||||||
|
double x = speed * dz * sin;
|
||||||
|
double y = speed * dy;
|
||||||
|
double z = speed * dz * -cos;
|
||||||
|
|
||||||
|
x += speed * dx * -cos;
|
||||||
|
z += speed * dx * -sin;
|
||||||
|
|
||||||
|
event.getBoat().setVelocity(new Vec3d(x, y, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
private void onReceivePacket(PacketEvent.Receive event) {
|
||||||
|
if (event.getPacket() instanceof VehicleMoveS2CPacket && cancelPackets.getValue()) {
|
||||||
|
event.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
|
||||||
|
public class Dolphin extends Module {
|
||||||
|
|
||||||
|
public Dolphin() {
|
||||||
|
super("delfín", "*ruido de delfín*", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null) return;
|
||||||
|
|
||||||
|
if (mc.player.isSubmergedInWater()) {
|
||||||
|
if (!mc.player.isJumping()) mc.player.jump();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -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.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
@@ -13,7 +13,7 @@ import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
|||||||
public class ElytraBounce extends Module {
|
public class ElytraBounce extends Module {
|
||||||
|
|
||||||
public ElytraBounce() {
|
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() {
|
public boolean bounce() {
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
|
||||||
|
public class ElytraFly extends Module {
|
||||||
|
|
||||||
|
public NumberSetting speed = sgGeneral.add(new NumberSetting(
|
||||||
|
"velocidad",
|
||||||
|
"mi madre es parcialmente vagabunda",
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
5,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public ElytraFly() {
|
||||||
|
super("elytras", "vuela con elytras", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || !mc.player.isGliding() || !wearingElytra()) return;
|
||||||
|
|
||||||
|
float yaw = mc.player.getYaw();
|
||||||
|
int dx = 0, dy = 0, dz = 0;
|
||||||
|
|
||||||
|
if (mc.options.rightKey.isPressed()) dx++;
|
||||||
|
if (mc.options.leftKey.isPressed()) dx--;
|
||||||
|
|
||||||
|
if (mc.options.jumpKey.isPressed()) dy++;
|
||||||
|
if (mc.options.sneakKey.isPressed()) dy--;
|
||||||
|
|
||||||
|
if (mc.options.backKey.isPressed()) dz++;
|
||||||
|
if (mc.options.forwardKey.isPressed()) dz--;
|
||||||
|
|
||||||
|
double speed = this.speed.getValue();
|
||||||
|
double sin = Math.sin(Math.toRadians(yaw));
|
||||||
|
double cos = Math.cos(Math.toRadians(yaw));
|
||||||
|
|
||||||
|
double x = speed * dz * sin;
|
||||||
|
double y = speed * dy;
|
||||||
|
double z = speed * dz * -cos;
|
||||||
|
|
||||||
|
x += speed * dx * -cos;
|
||||||
|
z += speed * dx * -sin;
|
||||||
|
|
||||||
|
mc.player.setVelocity(new Vec3d(x, y, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean wearingElytra() {
|
||||||
|
ItemStack equippedStack = mc.player.getEquippedStack(EquipmentSlot.CHEST);
|
||||||
|
return equippedStack != null && equippedStack.getItem() == Items.ELYTRA;
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-4
@@ -1,17 +1,17 @@
|
|||||||
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.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
|
||||||
public class Headhitters extends Module {
|
public class Headhitters extends Module {
|
||||||
|
|
||||||
public NumberSetting delay = addSetting(new NumberSetting("delay", "delay de saltos", 0, 0, 20, 1));
|
public NumberSetting delay = sgGeneral.add(new NumberSetting("delay", "delay de saltos", 0, 0, 20, 1));
|
||||||
|
|
||||||
public Headhitters() {
|
public Headhitters() {
|
||||||
super("headhitters",
|
super("headhitters",
|
||||||
"mantén pulsado el espacio para hacer headhitting sin tener que espamearlo",
|
"mantén pulsado el espacio para hacer headhitting sin tener que espamearlo",
|
||||||
Category.PLAYER);
|
Category.MOVEMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
|
import me.retucio.sputnik.event.events.UseItemEvent;
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.util.math.Box;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
// "pedido prestado" de: https://github.com/meanwhile131/elytra-infinite
|
||||||
|
public class InfiniteElytra extends Module {
|
||||||
|
|
||||||
|
private FlyState state;
|
||||||
|
private float pitch;
|
||||||
|
private double lowestY;
|
||||||
|
|
||||||
|
public NumberSetting pitchDown = sgGeneral.add(new NumberSetting(
|
||||||
|
"cabeceo (abajo)",
|
||||||
|
"cabeceo al ir hacia abajo",
|
||||||
|
30,
|
||||||
|
-90,
|
||||||
|
90,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
public NumberSetting pitchUp = sgGeneral.add(new NumberSetting(
|
||||||
|
"cabeceo (arriba)",
|
||||||
|
"cabeceo al ir hacia arriba",
|
||||||
|
-48,
|
||||||
|
-90,
|
||||||
|
90,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting pitchDownSpeed = sgGeneral.add(new NumberSetting(
|
||||||
|
"velocidad de cabeceo (abajo)",
|
||||||
|
"velocidad del cabeceo al ir hacia abajo",
|
||||||
|
0.5,
|
||||||
|
0.01,
|
||||||
|
5,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting pitchUpVelocity = sgGeneral.add(new NumberSetting(
|
||||||
|
"velocidad de cabeceo (arriba)",
|
||||||
|
"velocidad del cabeceo al ir hacia arriba",
|
||||||
|
2,
|
||||||
|
0.01,
|
||||||
|
5,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting ticksCollisionLookAhead = sgGeneral.add(new NumberSetting(
|
||||||
|
"precaución de colisión",
|
||||||
|
"precaución de colisión en ticks",
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
20,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
public InfiniteElytra() {
|
||||||
|
super("avioneta",
|
||||||
|
"vuela infinitamente, aprovechándose el sistema defectuoso que hizo mojang (hace falta tirarse de unos 50 bloques de altura)",
|
||||||
|
Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || mc.world == null || !mc.player.isGliding()) {
|
||||||
|
state = FlyState.NOT_FLYING;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state == FlyState.NOT_FLYING) {
|
||||||
|
state = FlyState.GLIDING_DOWN;
|
||||||
|
pitch = pitchDown.getFloatValue();
|
||||||
|
} else if (state == FlyState.PITCHING_DOWN) {
|
||||||
|
pitch += Math.min(pitchDown.getFloatValue() - pitch, pitchDownSpeed.getFloatValue());
|
||||||
|
boolean movingDownwards = mc.player.getVelocity().y <= 0 && mc.player.getY() > lowestY;
|
||||||
|
|
||||||
|
if (pitch >= pitchDown.getFloatValue() || movingDownwards) {
|
||||||
|
pitch = pitchDown.getFloatValue();
|
||||||
|
state = FlyState.GLIDING_DOWN;
|
||||||
|
}
|
||||||
|
} else if (state == FlyState.GLIDING_DOWN) {
|
||||||
|
boolean willCollide = willCollideWhileGliding(ticksCollisionLookAhead.getIntValue());
|
||||||
|
|
||||||
|
if (willCollide || mc.player.getVelocity().horizontalLengthSquared() > Math.pow(pitchUpVelocity.getFloatValue(), 2)) {
|
||||||
|
pitch = pitchUp.getFloatValue();
|
||||||
|
state = FlyState.PITCHING_DOWN;
|
||||||
|
lowestY = mc.player.getY();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mc.player.setPitch(pitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onUseItem(UseItemEvent event) {
|
||||||
|
if (mc.player == null) return;
|
||||||
|
if (mc.player.getStackInHand(event.getHand()).getItem() == Items.FIREWORK_ROCKET && !mc.player.isSpectator() && mc.player.isGliding()) {
|
||||||
|
pitch = pitchUp.getFloatValue();
|
||||||
|
mc.player.setPitch(pitch);
|
||||||
|
state = FlyState.PITCHING_DOWN;
|
||||||
|
lowestY = mc.player.getY();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean willCollideWhileGliding(int ticks) {
|
||||||
|
Vec3d velocity = mc.player.getVelocity();
|
||||||
|
Box boundingBox = mc.player.getBoundingBox();
|
||||||
|
for (int i = 0; i < ticks; i++) {
|
||||||
|
velocity = mc.player.calcGlidingVelocity(velocity);
|
||||||
|
boundingBox = boundingBox.offset(velocity);
|
||||||
|
if (!mc.world.isSpaceEmpty(null, boundingBox, true)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum FlyState {
|
||||||
|
NOT_FLYING,
|
||||||
|
GLIDING_DOWN,
|
||||||
|
PITCHING_DOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
|
import me.retucio.sputnik.event.events.BlockShapeEvent;
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.fluid.FluidState;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
|
|
||||||
|
public class Jesus extends Module {
|
||||||
|
|
||||||
|
SettingGroup sgBlocks = addSg(new SettingGroup("bloques", true));
|
||||||
|
|
||||||
|
public EnumSetting<JesusMode> mode = sgGeneral.add(new EnumSetting<>(
|
||||||
|
"modo",
|
||||||
|
"cómo caminar",
|
||||||
|
JesusMode.class,
|
||||||
|
JesusMode.SOLID
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting allowSneaking = sgGeneral.add(new BooleanSetting(
|
||||||
|
"permitir agacharse",
|
||||||
|
"te permite usar el botón de agacharse para sumergirte en el agua",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting minFallHeight = sgGeneral.add(new NumberSetting(
|
||||||
|
"distancia de caída",
|
||||||
|
"distancia de caída mínima para sumergirse en vez de impactar",
|
||||||
|
3,
|
||||||
|
0.1,
|
||||||
|
10,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting water = sgBlocks.add(new BooleanSetting(
|
||||||
|
"agua",
|
||||||
|
"permitir caminar en agua",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting lava = sgBlocks.add(new BooleanSetting(
|
||||||
|
"lava",
|
||||||
|
"permitir caminar en lava",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting powderedSnow = sgBlocks.add(new BooleanSetting(
|
||||||
|
"nieve en polvo",
|
||||||
|
"permitir caminar en nieve en polvo",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public Jesus() {
|
||||||
|
super("jesús", "te permite caminar sobre el agua", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
Entity entity = mc.player.getRootVehicle();
|
||||||
|
|
||||||
|
if (entity.isSneaking() && allowSneaking.getValue()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.fallDistance >= minFallHeight.getValue()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mode.is(JesusMode.VIBRATE)) return;
|
||||||
|
|
||||||
|
if (isSubmerged(entity.getEntityPos().add(new Vec3d(0, 0.3, 0)))) {
|
||||||
|
entity.setVelocity(entity.getVelocity().x, 0.08, entity.getVelocity().z);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (isSubmerged(entity.getEntityPos().add(new Vec3d(0, 0.1, 0)))) {
|
||||||
|
entity.setVelocity(entity.getVelocity().x, 0.05, entity.getVelocity().z);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (isSubmerged(entity.getEntityPos().add(new Vec3d(0, 0.05, 0)))) {
|
||||||
|
entity.setVelocity(entity.getVelocity().x, 0.01, entity.getVelocity().z);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (isSubmerged(entity.getEntityPos())) {
|
||||||
|
entity.setVelocity(entity.getVelocity().x, -0.005, entity.getVelocity().z);
|
||||||
|
entity.setOnGround(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onBlockShape(BlockShapeEvent event) {
|
||||||
|
if (event.getState().getBlock() == Blocks.LAVA && !lava.getValue()) return;
|
||||||
|
if (event.getState().getBlock() == Blocks.WATER && !water.getValue()) return;
|
||||||
|
if (event.getState().getBlock() == Blocks.POWDER_SNOW && !powderedSnow.getValue()) return;
|
||||||
|
if (mode.getValue() == JesusMode.SOLID)
|
||||||
|
if (event.getState().getBlock() == Blocks.POWDER_SNOW
|
||||||
|
&& !mc.player.isSneaking()
|
||||||
|
&& mc.player.getY() > event.getPos().getY() + 1) {
|
||||||
|
event.setShape(VoxelShapes.cuboid(0, 0, 0, 1, 1.01, 1));
|
||||||
|
} else if (!mc.world.getFluidState(event.getPos()).isEmpty()
|
||||||
|
&& !mc.player.isSneaking()
|
||||||
|
&& !mc.player.isTouchingWater()
|
||||||
|
&& mc.player.getY() >= event.getPos().getY() + 0.9) {
|
||||||
|
event.setShape(VoxelShapes.cuboid(0, 0, 0, 1, 0.9, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isSubmerged(Vec3d pos) {
|
||||||
|
BlockPos blockPos = BlockPos.ofFloored(pos);
|
||||||
|
FluidState state = mc.world.getFluidState(blockPos);
|
||||||
|
|
||||||
|
return !state.isEmpty() && pos.y - blockPos.getY() <= state.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum JesusMode {
|
||||||
|
VIBRATE("vibrador"),
|
||||||
|
SOLID("sólido");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
JesusMode(String name) { this.name = name; }
|
||||||
|
@Override public String toString() { return name; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
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;
|
||||||
|
import net.minecraft.util.hit.HitResult;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.world.RaycastContext;
|
||||||
|
|
||||||
|
public class ReverseStep extends Module {
|
||||||
|
|
||||||
|
public NumberSetting height = sgGeneral.add(new NumberSetting(
|
||||||
|
"altura", "altura máxima a bajar",
|
||||||
|
1, 0, 20, 0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting velocity = sgGeneral.add(new NumberSetting(
|
||||||
|
"velocidad", "velocidad a la que caer en bps",
|
||||||
|
1, 0, 10, 0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting jumping = sgGeneral.add(new BooleanSetting(
|
||||||
|
"saltar", "permitir saltar",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting disableInWater = sgGeneral.add(new BooleanSetting(
|
||||||
|
"desactivar en agua", ".",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public ReverseStep() {
|
||||||
|
super("escalones inversos",
|
||||||
|
"escalones pero pabajo",
|
||||||
|
Category.MOVEMENT
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
|
||||||
|
if (!mc.player.isOnGround()) {
|
||||||
|
if (jumping.getValue()) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((mc.player.isTouchingWater() || mc.player.isInLava())) {
|
||||||
|
if (disableInWater.getValue()) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double dropHeight = getHeight();
|
||||||
|
if (dropHeight > 0 && dropHeight <= height.getValue()) {
|
||||||
|
mc.player.addVelocity(0, -height.getValue() + mc.player.getVelocity().getY(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getHeight() {
|
||||||
|
Vec3d start = new Vec3d(mc.player.getX(), mc.player.getY() - 0.1, mc.player.getZ());
|
||||||
|
Vec3d end = new Vec3d(mc.player.getX(), mc.player.getY() - height.getValue() - 1, mc.player.getZ());
|
||||||
|
|
||||||
|
RaycastContext context = new RaycastContext(
|
||||||
|
start, end,
|
||||||
|
RaycastContext.ShapeType.COLLIDER,
|
||||||
|
RaycastContext.FluidHandling.ANY,
|
||||||
|
mc.player
|
||||||
|
);
|
||||||
|
|
||||||
|
HitResult hit = mc.world.raycast(context);
|
||||||
|
|
||||||
|
if (hit != null && hit.getType() == HitResult.Type.BLOCK) {
|
||||||
|
BlockPos hitPos = new BlockPos(
|
||||||
|
(int) hit.getPos().x,
|
||||||
|
(int) hit.getPos().y,
|
||||||
|
(int) hit.getPos().z
|
||||||
|
);
|
||||||
|
|
||||||
|
return mc.player.getY() - (hitPos.getY());
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
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.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.ClipAtLedgeEvent;
|
import me.retucio.sputnik.event.events.ClipAtLedgeEvent;
|
||||||
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.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.hit.HitResult;
|
import net.minecraft.util.hit.HitResult;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
@@ -13,12 +13,12 @@ import net.minecraft.world.RaycastContext;
|
|||||||
|
|
||||||
public class SafeWalk extends Module {
|
public class SafeWalk extends Module {
|
||||||
|
|
||||||
public NumberSetting fallDistance = addSetting(new NumberSetting("distancia de caída", "distancia de caída máxima permitida", 1, 0, 10, 0.1));
|
public NumberSetting fallDistance = sgGeneral.add(new NumberSetting("distancia de caída", "distancia de caída máxima permitida", 1, 0, 10, 0.1));
|
||||||
|
|
||||||
public SafeWalk() {
|
public SafeWalk() {
|
||||||
super("muletas",
|
super("muletas",
|
||||||
"te ayuda a no caerte de bloques, sin agacharte",
|
"te ayuda a no caerte de bloques, sin agacharte",
|
||||||
Category.PLAYER);
|
Category.MOVEMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.mixin.accessor.AbstractBlockAccessor;
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.util.math.Vec3i;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Slippy extends Module {
|
||||||
|
|
||||||
|
public NumberSetting slipperiness = sgGeneral.add(new NumberSetting(
|
||||||
|
"cantidad de semen",
|
||||||
|
"cuánto semen agregar a los bloques por los que pasas",
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0.01
|
||||||
|
));
|
||||||
|
|
||||||
|
private final Map<Block, Float> modifiedBlocks = new HashMap<>();
|
||||||
|
|
||||||
|
public Slippy() {
|
||||||
|
super("patinaje", "añade una fina capa de semen a los bloques que pisas", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
for (Block block : modifiedBlocks.keySet()) {
|
||||||
|
((AbstractBlockAccessor) block).setSlipperiness(modifiedBlocks.get(block));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
Block block = mc.world.getBlockState(mc.player.getBlockPos().add(new Vec3i(0, -1, 0))).getBlock();
|
||||||
|
if (block.getSlipperiness() == slipperiness.getFloatValue()) return;
|
||||||
|
if (!modifiedBlocks.containsKey(block)) modifiedBlocks.put(block, block.getSlipperiness());
|
||||||
|
((AbstractBlockAccessor) block).setSlipperiness(slipperiness.getFloatValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
public class Step extends Module {
|
||||||
|
|
||||||
|
public NumberSetting height = sgGeneral.add(new NumberSetting(
|
||||||
|
"altura", "altura máxima a subir",
|
||||||
|
1, 0, 3, 0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public Step() {
|
||||||
|
super("escalones", "hace que el bloque de subida de escalón sea la distancia deseada", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.movement;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
|
||||||
|
public class TridentBoost extends Module {
|
||||||
|
|
||||||
|
public NumberSetting multiplier = sgGeneral.add(new NumberSetting(
|
||||||
|
"boost",
|
||||||
|
"multiplicador del movimiento",
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
5,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting outOfWater = sgGeneral.add(new BooleanSetting(
|
||||||
|
"fuera del agua",
|
||||||
|
"permitir el uso de la propulsión acuática fuera del agua",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public TridentBoost() {
|
||||||
|
super("tenedor mágico", "hermano se piensa que es Poseidón", Category.MOVEMENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,12 @@ package me.retucio.sputnik.module.modules.network;
|
|||||||
|
|
||||||
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.settings.StringSetting;
|
import me.retucio.sputnik.module.setting.settings.StringSetting;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
|
|
||||||
public class BungeecordSpoofer extends Module {
|
public class BungeecordSpoofer extends Module {
|
||||||
|
|
||||||
public StringSetting address = addSetting(new StringSetting("dirección", "la dirección IP que será enviada al server", "127.0.0.1", 15));
|
public StringSetting address = sgGeneral.add(new StringSetting("dirección", "la dirección IP que será enviada al server", "127.0.0.1", 15));
|
||||||
|
|
||||||
public BungeecordSpoofer() {
|
public BungeecordSpoofer() {
|
||||||
super("spoofer de bungeecord",
|
super("spoofer de bungeecord",
|
||||||
|
|||||||
@@ -2,14 +2,15 @@ package me.retucio.sputnik.module.modules.network;
|
|||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.AddEntityEvent;
|
import me.retucio.sputnik.event.events.AddEntityEvent;
|
||||||
import me.retucio.sputnik.event.events.RenderWorldEvent;
|
import me.retucio.sputnik.event.events.Render3DEvent;
|
||||||
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.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.FakePlayer;
|
import me.retucio.sputnik.module.modules.misc.FakePlayer;
|
||||||
import me.retucio.sputnik.module.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.util.MiscUtil;
|
import me.retucio.sputnik.util.MiscUtil;
|
||||||
import me.retucio.sputnik.util.render.RenderUtil;
|
import me.retucio.sputnik.util.render.RenderUtil;
|
||||||
import net.minecraft.client.network.OtherClientPlayerEntity;
|
import net.minecraft.client.network.OtherClientPlayerEntity;
|
||||||
@@ -31,16 +32,20 @@ import java.util.UUID;
|
|||||||
// lógica sutilmente robada de MeteorClient porque la mía era una mierda
|
// lógica sutilmente robada de MeteorClient porque la mía era una mierda
|
||||||
public class LogoutSpots extends Module {
|
public class LogoutSpots extends Module {
|
||||||
|
|
||||||
public BooleanSetting outlines = addSetting(new BooleanSetting("contorno", "renderizar contorno de la caja (lados)", true));
|
SettingGroup sgOutlines = addSg(new SettingGroup("contorno", true));
|
||||||
public ColorSetting outlineColor = addSetting(new ColorSetting("color del contorno", "Color de las líneas", new Color(255, 0, 0, 230), false));
|
SettingGroup sgFilling = addSg(new SettingGroup("relleno", true));
|
||||||
public NumberSetting lineWidth = addSetting(new NumberSetting("grosor de línea", "grosor de las líneas del contorno", 1.5, 0.5, 5, 0.1));
|
SettingGroup sgMisc = addSg(new SettingGroup("misc.", true));
|
||||||
|
|
||||||
public BooleanSetting filling = addSetting(new BooleanSetting("relleno", "renderizar relleno de la caja (caras)", true));
|
public BooleanSetting outlines = sgOutlines.add(new BooleanSetting("contorno", "renderizar contorno de la caja (lados)", true));
|
||||||
public ColorSetting fillingColor = addSetting(new ColorSetting("color del relleno", "Color de los lados", new Color(230, 0, 0, 55), false));
|
public ColorSetting outlineColor = sgOutlines.add(new ColorSetting("color del contorno", "Color de las líneas", new Color(255, 0, 0, 230), false));
|
||||||
|
public NumberSetting lineWidth = sgOutlines.add(new NumberSetting("grosor de línea", "grosor de las líneas del contorno", 1.5, 0.5, 5, 0.1));
|
||||||
|
|
||||||
public BooleanSetting fullHeight = addSetting(new BooleanSetting("hitbox completa", "renderizar la caja completa de la hitbox, o solo marcar la posición", true));
|
public BooleanSetting filling = sgFilling.add(new BooleanSetting("relleno", "renderizar relleno de la caja (caras)", true));
|
||||||
|
public ColorSetting fillingColor = sgFilling.add(new ColorSetting("color del relleno", "Color de los lados", new Color(230, 0, 0, 55), false));
|
||||||
|
|
||||||
public BooleanSetting dummy = addSetting(new BooleanSetting("monigote", "spawnear un monigote para marcar la posición", true));
|
public BooleanSetting fullHeight = sgMisc.add(new BooleanSetting("hitbox completa", "renderizar la caja completa de la hitbox, o solo marcar la posición", true));
|
||||||
|
|
||||||
|
public BooleanSetting dummy = sgMisc.add(new BooleanSetting("monigote", "spawnear un monigote para marcar la posición", true));
|
||||||
|
|
||||||
private final List<LogoutEntry> players = new ArrayList<>();
|
private final List<LogoutEntry> players = new ArrayList<>();
|
||||||
private final List<PlayerListEntry> lastPlayerList = new ArrayList<>();
|
private final List<PlayerListEntry> lastPlayerList = new ArrayList<>();
|
||||||
@@ -56,12 +61,12 @@ public class LogoutSpots extends Module {
|
|||||||
|
|
||||||
outlines.onUpdate(v -> {
|
outlines.onUpdate(v -> {
|
||||||
outlineColor.setVisible(v);
|
outlineColor.setVisible(v);
|
||||||
fullHeight.setVisible(v || filling.isEnabled());
|
fullHeight.setVisible(v || filling.getValue());
|
||||||
});
|
});
|
||||||
|
|
||||||
filling.onUpdate(v -> {
|
filling.onUpdate(v -> {
|
||||||
fillingColor.setVisible(v);
|
fillingColor.setVisible(v);
|
||||||
fullHeight.setVisible(v || outlines.isEnabled());
|
fullHeight.setVisible(v || outlines.getValue());
|
||||||
});
|
});
|
||||||
|
|
||||||
dummy.onUpdate(v -> {
|
dummy.onUpdate(v -> {
|
||||||
@@ -111,7 +116,7 @@ public class LogoutSpots extends Module {
|
|||||||
if (player.getUuid().equals(entry.getProfile().id())) {
|
if (player.getUuid().equals(entry.getProfile().id())) {
|
||||||
LogoutEntry logoutEntry = new LogoutEntry(player);
|
LogoutEntry logoutEntry = new LogoutEntry(player);
|
||||||
|
|
||||||
if (mc.world != null && !mc.world.hasEntity(logoutEntry.dummy) && dummy.isEnabled())
|
if (mc.world != null && !mc.world.hasEntity(logoutEntry.dummy) && dummy.getValue())
|
||||||
mc.world.addEntity(logoutEntry.dummy);
|
mc.world.addEntity(logoutEntry.dummy);
|
||||||
|
|
||||||
addLogoutSpot(logoutEntry);
|
addLogoutSpot(logoutEntry);
|
||||||
@@ -165,7 +170,7 @@ public class LogoutSpots extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onWorldRender(RenderWorldEvent event) {
|
public void onWorldRender(Render3DEvent event) {
|
||||||
if (mc.player == null || mc.world == null) return;
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
|
||||||
for (LogoutEntry entry : players)
|
for (LogoutEntry entry : players)
|
||||||
@@ -243,21 +248,21 @@ public class LogoutSpots extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void renderBox(MatrixStack matrices) {
|
public void renderBox(MatrixStack matrices) {
|
||||||
if (fullHeight.isEnabled()) {
|
if (fullHeight.getValue()) {
|
||||||
if (outlines.isEnabled())
|
if (outlines.getValue())
|
||||||
RenderUtil.drawOutlineBox(matrices, new Box(x, y, z, x + xWidth, y + height, z + zWidth), outlineColor.getColor(), lineWidth.getFloatValue(), true);
|
RenderUtil.drawOutlineBox(matrices, new Box(x, y, z, x + xWidth, y + height, z + zWidth), outlineColor.getValue(), lineWidth.getFloatValue(), true);
|
||||||
if (filling.isEnabled())
|
if (filling.getValue())
|
||||||
RenderUtil.drawFilledBox(matrices, new Box(x, y, z, x + xWidth, y + height, z + zWidth), fillingColor.getColor(), true);
|
RenderUtil.drawFilledBox(matrices, new Box(x, y, z, x + xWidth, y + height, z + zWidth), fillingColor.getValue(), true);
|
||||||
} else {
|
} else {
|
||||||
if (outlines.isEnabled()) {
|
if (outlines.getValue()) {
|
||||||
RenderUtil.drawBlockFaceOutlines(matrices,
|
RenderUtil.drawBlockFaceOutlines(matrices,
|
||||||
BlockPos.ofFloored(x + halfWidth, y, z + halfWidth),
|
BlockPos.ofFloored(x + halfWidth, y, z + halfWidth),
|
||||||
Direction.UP, outlineColor.getColor(), lineWidth.getFloatValue(), true);
|
Direction.UP, outlineColor.getValue(), lineWidth.getFloatValue(), true);
|
||||||
}
|
}
|
||||||
if (filling.isEnabled()) {
|
if (filling.getValue()) {
|
||||||
RenderUtil.drawBlockFaceFilled(matrices,
|
RenderUtil.drawBlockFaceFilled(matrices,
|
||||||
BlockPos.ofFloored(x + halfWidth, y, z + halfWidth),
|
BlockPos.ofFloored(x + halfWidth, y, z + halfWidth),
|
||||||
Direction.UP, fillingColor.getColor(), 0.001f, true);
|
Direction.UP, fillingColor.getValue(), 0.001f, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import me.retucio.sputnik.event.SubscribeEvent;
|
|||||||
import me.retucio.sputnik.event.events.PacketEvent;
|
import me.retucio.sputnik.event.events.PacketEvent;
|
||||||
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.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
import me.retucio.sputnik.module.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.NetworkUtil;
|
import me.retucio.sputnik.util.NetworkUtil;
|
||||||
|
|
||||||
@@ -22,10 +22,10 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||||||
|
|
||||||
public class PacketDelay extends Module {
|
public class PacketDelay extends Module {
|
||||||
|
|
||||||
public NumberSetting delay = addSetting(new NumberSetting("delay", "delay a añadir a los paquetes, en milisegundos", 1500, 0, 3000, 5));
|
public NumberSetting delay = sgGeneral.add(new NumberSetting("delay", "delay a añadir a los paquetes, en milisegundos", 1500, 0, 3000, 5));
|
||||||
public EnumSetting<Directions> directions = addSetting(new EnumSetting<>("dirección", "dirección de los paquetes a los que añadir delay",
|
public EnumSetting<Directions> directions = sgGeneral.add(new EnumSetting<>("dirección", "dirección de los paquetes a los que añadir delay",
|
||||||
Directions.class, Directions.BOTH));
|
Directions.class, Directions.BOTH));
|
||||||
public EnumSetting<Packets> packets = addSetting(new EnumSetting<>("paquetes", "paquetes a los que aplicar el delay",
|
public EnumSetting<Packets> packets = sgGeneral.add(new EnumSetting<>("paquetes", "paquetes a los que aplicar el delay",
|
||||||
Packets.class, Packets.ALL));
|
Packets.class, Packets.ALL));
|
||||||
|
|
||||||
private final List<DelayedPacket> delayedPackets = new CopyOnWriteArrayList<>();
|
private final List<DelayedPacket> delayedPackets = new CopyOnWriteArrayList<>();
|
||||||
|
|||||||
@@ -0,0 +1,169 @@
|
|||||||
|
package me.retucio.sputnik.module.modules.network;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
|
import me.retucio.sputnik.event.events.AttackBlockEvent;
|
||||||
|
import me.retucio.sputnik.event.events.Render3DEvent;
|
||||||
|
import me.retucio.sputnik.module.Category;
|
||||||
|
import me.retucio.sputnik.module.Module;
|
||||||
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import me.retucio.sputnik.util.render.RenderUtil;
|
||||||
|
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PacketMine extends Module {
|
||||||
|
|
||||||
|
SettingGroup sgRender = addSg(new SettingGroup("renderizado", true));
|
||||||
|
|
||||||
|
public NumberSetting retryTime = sgGeneral.add(new NumberSetting(
|
||||||
|
"delay",
|
||||||
|
"delay entre reintentos de minado",
|
||||||
|
30,
|
||||||
|
0,
|
||||||
|
1000,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting cancelOutOfReach = sgGeneral.add(new BooleanSetting(
|
||||||
|
"cancelar fuera de alcance",
|
||||||
|
"cancelar aquellos paquetes que intenten romper bloques fuera del alcance del jugador, para evitar flaggear el anticheat",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting render = sgRender.add(new BooleanSetting(
|
||||||
|
"renderizar",
|
||||||
|
"renderizar un contorno alrededor de los bloques que están siendo minados",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public ColorSetting color = sgRender.add(new ColorSetting(
|
||||||
|
"color",
|
||||||
|
"color del contorno renderizado",
|
||||||
|
new Color(0, 255, 0, 100),
|
||||||
|
false
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting lineWidth = sgRender.add(new NumberSetting(
|
||||||
|
"grosor",
|
||||||
|
"grosor de las líneas del contorno",
|
||||||
|
2,
|
||||||
|
0.1,
|
||||||
|
10,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
public PacketMine() {
|
||||||
|
super("selección de minado",
|
||||||
|
"selecciona bloques a minar con paquetes",
|
||||||
|
Category.NETWORK);
|
||||||
|
|
||||||
|
render.onUpdate(v -> {
|
||||||
|
color.setVisible(v);
|
||||||
|
lineWidth.setVisible(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private final List<MiningBlock> miningBlocks = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
miningBlocks.clear();
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTick() {
|
||||||
|
if (mc.player == null || mc.world == null || mc.interactionManager == null) return;
|
||||||
|
|
||||||
|
Iterator<MiningBlock> iterator = miningBlocks.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
MiningBlock block = iterator.next();
|
||||||
|
|
||||||
|
if (mc.world.getBlockState(block.pos).isAir()) {
|
||||||
|
iterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!block.mining) {
|
||||||
|
block.mine();
|
||||||
|
} else {
|
||||||
|
if (mc.player.age - block.startTime >= retryTime.getValue()) {
|
||||||
|
block.startTime = mc.player.age;
|
||||||
|
block.mining = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onAttackBlock(AttackBlockEvent event) {
|
||||||
|
event.cancel();
|
||||||
|
if (!isMining(event.getPos())) {
|
||||||
|
miningBlocks.add(new MiningBlock(event));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onRenderWorld(Render3DEvent event) {
|
||||||
|
for (MiningBlock block : miningBlocks) {
|
||||||
|
block.render(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isMining(BlockPos pos) {
|
||||||
|
for (MiningBlock block : miningBlocks) {
|
||||||
|
if (block.pos.equals(pos)) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MiningBlock {
|
||||||
|
|
||||||
|
BlockPos pos;
|
||||||
|
Direction dir;
|
||||||
|
boolean mining;
|
||||||
|
long startTime;
|
||||||
|
|
||||||
|
public MiningBlock(AttackBlockEvent event) {
|
||||||
|
this.pos = event.getPos();
|
||||||
|
this.dir = event.getDir();
|
||||||
|
mining = false;
|
||||||
|
startTime = mc.player.age;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mine() {
|
||||||
|
if (pos.getSquaredDistance(mc.player.getEntityPos()) > Math.pow(mc.player.getBlockInteractionRange(), 2)
|
||||||
|
&& cancelOutOfReach.getValue()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mc.interactionManager.sendSequencedPacket(mc.world, sequence ->
|
||||||
|
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, pos, dir, sequence));
|
||||||
|
mining = true;
|
||||||
|
mc.interactionManager.sendSequencedPacket(mc.world, sequence ->
|
||||||
|
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, pos, dir, sequence));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(Render3DEvent event) {
|
||||||
|
VoxelShape shape = mc.world.getBlockState(pos).getOutlineShape(mc.world, pos);
|
||||||
|
|
||||||
|
RenderUtil.drawVoxelShapeOutline(
|
||||||
|
event.getMatrices(),
|
||||||
|
shape,
|
||||||
|
pos,
|
||||||
|
color.getValue(),
|
||||||
|
lineWidth.getFloatValue(),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,14 +4,14 @@ import me.retucio.sputnik.event.SubscribeEvent;
|
|||||||
import me.retucio.sputnik.event.events.AttackEntityEvent;
|
import me.retucio.sputnik.event.events.AttackEntityEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
|
||||||
public class AttributeSwapper extends Module {
|
public class AttributeSwapper extends Module {
|
||||||
|
|
||||||
public NumberSetting slot = addSetting(new NumberSetting("slot", "slot al que cambiar", 1, 1, 9, 1));
|
public NumberSetting slot = sgGeneral.add(new NumberSetting("slot", "slot al que cambiar", 1, 1, 9, 1));
|
||||||
public BooleanSetting swap = addSetting(new BooleanSetting("cambiar de vuelta", "volver al slot inicial tras haber aplicado el swapping", true));
|
public BooleanSetting swap = sgGeneral.add(new BooleanSetting("cambiar de vuelta", "volver al slot inicial tras haber aplicado el swapping", true));
|
||||||
public NumberSetting swapDelay = addSetting(new NumberSetting("delay de cambio de vuelta", "tiempo que se tarda en volver al slot inicial", 1, 1, 20, 1));
|
public 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;
|
||||||
@@ -24,7 +24,7 @@ public class AttributeSwapper extends Module {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTick() {
|
public void onTick() {
|
||||||
if (mc.player == null || !swap.isEnabled()) return;
|
if (mc.player == null || !swap.getValue()) return;
|
||||||
if (delay < swapDelay.getIntValue()) delay++;
|
if (delay < swapDelay.getIntValue()) delay++;
|
||||||
if (delay >= swapDelay.getIntValue() && prevSlot != -1) {
|
if (delay >= swapDelay.getIntValue() && prevSlot != -1) {
|
||||||
mc.player.getInventory().setSelectedSlot(prevSlot);
|
mc.player.getInventory().setSelectedSlot(prevSlot);
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import me.retucio.sputnik.cape.Cape;
|
|||||||
import me.retucio.sputnik.cape.CapeManager;
|
import me.retucio.sputnik.cape.CapeManager;
|
||||||
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.settings.OptionSetting;
|
import me.retucio.sputnik.module.setting.settings.OptionSetting;
|
||||||
|
|
||||||
public class Capes extends Module {
|
public class Capes extends Module {
|
||||||
|
|
||||||
public OptionSetting<Cape> cape = addSetting(new OptionSetting<>("capa", "qué capa llevar puesta",
|
public OptionSetting<Cape> cape = sgGeneral.add(new OptionSetting<>("capa", "qué capa llevar puesta",
|
||||||
CapeManager.INSTANCE.getCapes(), CapeManager.INSTANCE.getCape("hollow-knight")));
|
CapeManager.INSTANCE.getCapes(), CapeManager.INSTANCE.getCape("hollow-knight")));
|
||||||
|
|
||||||
public Capes() {
|
public Capes() {
|
||||||
|
|||||||
@@ -2,31 +2,72 @@ package me.retucio.sputnik.module.modules.player;
|
|||||||
|
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
public class FastUse extends Module {
|
public class FastUse extends Module {
|
||||||
|
|
||||||
public BooleanSetting items = addSetting(new BooleanSetting("items", "usar items precozmente", true));
|
public BooleanSetting items = sgGeneral.add(new BooleanSetting(
|
||||||
public NumberSetting itemCooldown = addSetting(new NumberSetting("cooldown de items", "cooldown para usar items en ticks", 0, 0, 4, 1));
|
"items",
|
||||||
|
"usar items precozmente",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting itemCooldown = sgGeneral.add(new NumberSetting(
|
||||||
|
"cooldown de items",
|
||||||
|
"cooldown para usar items en ticks",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
4,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
public BooleanSetting blocks = sgGeneral.add(new BooleanSetting(
|
||||||
|
"bloques",
|
||||||
|
"colocar bloques precozmente",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting blockCooldown = sgGeneral.add(new NumberSetting(
|
||||||
|
"cooldown de bloques",
|
||||||
|
"cooldown para colocar bloques en ticks",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
4,
|
||||||
|
1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
public BooleanSetting mining = sgGeneral.add(new BooleanSetting(
|
||||||
|
"minar",
|
||||||
|
"minar precozmente",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting miningCooldown = sgGeneral.add(new NumberSetting(
|
||||||
|
"cooldown al minar",
|
||||||
|
"cooldown entre rotura de bloques en ticks",
|
||||||
|
5, 0, 20, 1
|
||||||
|
));
|
||||||
|
|
||||||
public BooleanSetting blocks = addSetting(new BooleanSetting("bloques", "colocar bloques precozmente", true));
|
|
||||||
public NumberSetting blockCooldown = addSetting(new NumberSetting("cooldown de bloques", "cooldown para colocar bloques en ticks", 0, 0, 4, 1));
|
|
||||||
|
|
||||||
public FastUse() {
|
public FastUse() {
|
||||||
super("precoz",
|
super("precoz",
|
||||||
"hace cosas como usar items o colocar bloques más rápido",
|
"hace cosas como usar items o colocar bloques más rápido",
|
||||||
Category.PLAYER);
|
Category.PLAYER,
|
||||||
|
GLFW.GLFW_KEY_F6);
|
||||||
|
|
||||||
items.onUpdate(v -> itemCooldown.setVisible(v));
|
items.onUpdate(v -> itemCooldown.setVisible(v));
|
||||||
blocks.onUpdate(v -> blockCooldown.setVisible(v));
|
blocks.onUpdate(v -> blockCooldown.setVisible(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCooldown(ItemStack stack) {
|
public int getCooldown(ItemStack stack) {
|
||||||
if (stack.getItem() instanceof BlockItem && blocks.isEnabled()) return blockCooldown.getIntValue();
|
if (stack.getItem() instanceof BlockItem && blocks.getValue()) return blockCooldown.getIntValue();
|
||||||
if (items.isEnabled() && !(stack.getItem() instanceof BlockItem)) return itemCooldown.getIntValue();
|
if (items.getValue() && !(stack.getItem() instanceof BlockItem)) return itemCooldown.getIntValue();
|
||||||
else return 4; // cooldown por defecto, 4 ticks
|
else return 4; // cooldown por defecto, 4 ticks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,9 @@ import me.retucio.sputnik.event.events.RenderHeldItemEvent;
|
|||||||
import me.retucio.sputnik.event.events.RenderArmEvent;
|
import me.retucio.sputnik.event.events.RenderArmEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.RotationAxis;
|
||||||
@@ -18,75 +19,80 @@ import org.joml.Vector3d;
|
|||||||
|
|
||||||
public class HandView extends Module {
|
public class HandView extends Module {
|
||||||
|
|
||||||
|
SettingGroup sgAnimations = addSg(new SettingGroup("animaciones", false));
|
||||||
|
SettingGroup sgMainHand = addSg(new SettingGroup("mano principal", false));
|
||||||
|
SettingGroup sgOffhand = addSg(new SettingGroup("mano secundaria", false));
|
||||||
|
SettingGroup sgArm = addSg(new SettingGroup("brazo", false));
|
||||||
|
|
||||||
// ajustes de animaciones
|
// ajustes de animaciones
|
||||||
public BooleanSetting oldAnimations = addSetting(new BooleanSetting("animaciones viejas", "como las de la 1.8, al pegar", false));
|
public BooleanSetting oldAnimations = sgAnimations.add(new BooleanSetting("animaciones viejas", "como las de la 1.8, al pegar", false));
|
||||||
public BooleanSetting skipSwapping = addSetting(new BooleanSetting("no swap", "se salta la animación de cambiar items de mano", false));
|
public BooleanSetting skipSwapping = sgAnimations.add(new BooleanSetting("no swap", "se salta la animación de cambiar items de mano", false));
|
||||||
public BooleanSetting noFood = addSetting(new BooleanSetting("no comer", "no renderiza la animación de comer", false));
|
public BooleanSetting noFood = sgAnimations.add(new BooleanSetting("no comer", "no renderiza la animación de comer", false));
|
||||||
|
|
||||||
// ajustes de mano principal
|
// ajustes de mano principal
|
||||||
public NumberSetting scaleMainX = addSetting(new NumberSetting("escala de la mano principal (X)", ".",
|
public NumberSetting scaleMainX = sgMainHand.add(new NumberSetting("escala de la mano principal (X)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
public NumberSetting scaleMainY = addSetting(new NumberSetting("escala de la mano principal (Y)", ".",
|
public NumberSetting scaleMainY = sgMainHand.add(new NumberSetting("escala de la mano principal (Y)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
public NumberSetting scaleMainZ = addSetting(new NumberSetting("escala de la mano principal (Z)", ".",
|
public NumberSetting scaleMainZ = sgMainHand.add(new NumberSetting("escala de la mano principal (Z)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
|
|
||||||
public NumberSetting posMainX = addSetting(new NumberSetting("posición de la mano principal (X)", ".",
|
public NumberSetting posMainX = sgMainHand.add(new NumberSetting("posición de la mano principal (X)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
public NumberSetting posMainY = addSetting(new NumberSetting("posición de la mano principal (Y)", ".",
|
public NumberSetting posMainY = sgMainHand.add(new NumberSetting("posición de la mano principal (Y)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
public NumberSetting posMainZ = addSetting(new NumberSetting("posición de la mano principal (Z)", ".",
|
public NumberSetting posMainZ = sgMainHand.add(new NumberSetting("posición de la mano principal (Z)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
|
|
||||||
public NumberSetting rotMainX = addSetting(new NumberSetting("rotación de la mano principal (X)", ".",
|
public NumberSetting rotMainX = sgMainHand.add(new NumberSetting("rotación de la mano principal (X)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
public NumberSetting rotMainY = addSetting(new NumberSetting("rotación de la mano principal (Y)", ".",
|
public NumberSetting rotMainY = sgMainHand.add(new NumberSetting("rotación de la mano principal (Y)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
public NumberSetting rotMainZ = addSetting(new NumberSetting("rotación de la mano principal (Z)", ".",
|
public NumberSetting rotMainZ = sgMainHand.add(new NumberSetting("rotación de la mano principal (Z)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
|
|
||||||
// ajustes de mano secundaria
|
// ajustes de mano secundaria
|
||||||
public NumberSetting scaleOffX = addSetting(new NumberSetting("escala de la mano secundaria (X)", ".",
|
public NumberSetting scaleOffX = sgOffhand.add(new NumberSetting("escala de la mano secundaria (X)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
public NumberSetting scaleOffY = addSetting(new NumberSetting("escala de la mano secundaria (Y)", ".",
|
public NumberSetting scaleOffY = sgOffhand.add(new NumberSetting("escala de la mano secundaria (Y)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
public NumberSetting scaleOffZ = addSetting(new NumberSetting("escala de la mano secundaria (Z)", ".",
|
public NumberSetting scaleOffZ = sgOffhand.add(new NumberSetting("escala de la mano secundaria (Z)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
|
|
||||||
public NumberSetting posOffX = addSetting(new NumberSetting("posición de la mano secundaria (X)", ".",
|
public NumberSetting posOffX = sgOffhand.add(new NumberSetting("posición de la mano secundaria (X)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
public NumberSetting posOffY = addSetting(new NumberSetting("posición de la mano secundaria (Y)", ".",
|
public NumberSetting posOffY = sgOffhand.add(new NumberSetting("posición de la mano secundaria (Y)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
public NumberSetting posOffZ = addSetting(new NumberSetting("posición de la mano secundaria (Z)", ".",
|
public NumberSetting posOffZ = sgOffhand.add(new NumberSetting("posición de la mano secundaria (Z)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
|
|
||||||
public NumberSetting rotOffX = addSetting(new NumberSetting("rotación de la mano secundaria (X)", ".",
|
public NumberSetting rotOffX = sgOffhand.add(new NumberSetting("rotación de la mano secundaria (X)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
public NumberSetting rotOffY = addSetting(new NumberSetting("rotación de la mano secundaria (Y)", ".",
|
public NumberSetting rotOffY = sgOffhand.add(new NumberSetting("rotación de la mano secundaria (Y)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
public NumberSetting rotOffZ = addSetting(new NumberSetting("rotación de la mano secundaria (Z)", ".",
|
public NumberSetting rotOffZ = sgOffhand.add(new NumberSetting("rotación de la mano secundaria (Z)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
|
|
||||||
// brazo
|
// brazo
|
||||||
public NumberSetting scaleArmX = addSetting(new NumberSetting("escala del brazo (X)", ".",
|
public NumberSetting scaleArmX = sgArm.add(new NumberSetting("escala del brazo (X)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
public NumberSetting scaleArmY = addSetting(new NumberSetting("escala del brazo (Y)", ".",
|
public NumberSetting scaleArmY = sgArm.add(new NumberSetting("escala del brazo (Y)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
public NumberSetting scaleArmZ = addSetting(new NumberSetting("escala del brazo (Z)", ".",
|
public NumberSetting scaleArmZ = sgArm.add(new NumberSetting("escala del brazo (Z)", ".",
|
||||||
1, 0.01, 5, 0.1));
|
1, 0.01, 5, 0.1));
|
||||||
|
|
||||||
public NumberSetting posArmX = addSetting(new NumberSetting("posición del brazo (X)", ".",
|
public NumberSetting posArmX = sgArm.add(new NumberSetting("posición del brazo (X)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
public NumberSetting posArmY = addSetting(new NumberSetting("posición del brazo (Y)", ".",
|
public NumberSetting posArmY = sgArm.add(new NumberSetting("posición del brazo (Y)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
public NumberSetting posArmZ = addSetting(new NumberSetting("posición del brazo (Z)", ".",
|
public NumberSetting posArmZ = sgArm.add(new NumberSetting("posición del brazo (Z)", ".",
|
||||||
0, -3, 3, 0.1));
|
0, -3, 3, 0.1));
|
||||||
|
|
||||||
public NumberSetting rotArmX = addSetting(new NumberSetting("rotación del brazo (X)", ".",
|
public NumberSetting rotArmX = sgArm.add(new NumberSetting("rotación del brazo (X)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
public NumberSetting rotArmY = addSetting(new NumberSetting("rotación del brazo (Y)", ".",
|
public NumberSetting rotArmY = sgArm.add(new NumberSetting("rotación del brazo (Y)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
public NumberSetting rotArmZ = addSetting(new NumberSetting("rotación del brazo (Z)", ".",
|
public NumberSetting rotArmZ = sgArm.add(new NumberSetting("rotación del brazo (Z)", ".",
|
||||||
0, -180, 180, 1));
|
0, -180, 180, 1));
|
||||||
|
|
||||||
public HandView() {
|
public HandView() {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import me.retucio.sputnik.event.events.MouseClickEvent;
|
|||||||
import me.retucio.sputnik.mixin.accessor.HandledScreenAccessor;
|
import me.retucio.sputnik.mixin.accessor.HandledScreenAccessor;
|
||||||
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.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
import me.retucio.sputnik.util.InventoryUtil;
|
import me.retucio.sputnik.util.InventoryUtil;
|
||||||
import me.retucio.sputnik.util.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||||
@@ -16,9 +16,9 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
|
|
||||||
public class InventoryPlus extends Module {
|
public class InventoryPlus extends Module {
|
||||||
|
|
||||||
public KeySetting row1key = addSetting(new KeySetting("fila 1", "tecla para mover items a la primera fila", GLFW.GLFW_KEY_A));
|
public KeySetting row1key = sgGeneral.add(new KeySetting("fila 1", "tecla para mover items a la primera fila", GLFW.GLFW_KEY_A));
|
||||||
public KeySetting row2key = addSetting(new KeySetting("fila 2", "tecla para mover items a la segunda fila", GLFW.GLFW_KEY_S));
|
public KeySetting row2key = sgGeneral.add(new KeySetting("fila 2", "tecla para mover items a la segunda fila", GLFW.GLFW_KEY_S));
|
||||||
public KeySetting row3key = addSetting(new KeySetting("fila 3", "tecla para mover items a la tercera fila", GLFW.GLFW_KEY_D));
|
public KeySetting row3key = sgGeneral.add(new KeySetting("fila 3", "tecla para mover items a la tercera fila", GLFW.GLFW_KEY_D));
|
||||||
|
|
||||||
public InventoryPlus() {
|
public InventoryPlus() {
|
||||||
super("inventario plus",
|
super("inventario plus",
|
||||||
@@ -50,15 +50,15 @@ public class InventoryPlus extends Module {
|
|||||||
|
|
||||||
int rowOffset = InventoryUtil.getRowOffset(screen);
|
int rowOffset = InventoryUtil.getRowOffset(screen);
|
||||||
|
|
||||||
if (KeyUtil.isKeyDown(row1key.getKey())) {
|
if (KeyUtil.isKeyDown(row1key.getValue())) {
|
||||||
event.cancel();
|
event.cancel();
|
||||||
swapWithRow(screen, containerSlot, hotbarKeyIndex, rowOffset);
|
swapWithRow(screen, containerSlot, hotbarKeyIndex, rowOffset);
|
||||||
}
|
}
|
||||||
else if (KeyUtil.isKeyDown(row2key.getKey())) {
|
else if (KeyUtil.isKeyDown(row2key.getValue())) {
|
||||||
event.cancel();
|
event.cancel();
|
||||||
swapWithRow(screen, containerSlot, hotbarKeyIndex, rowOffset + 9);
|
swapWithRow(screen, containerSlot, hotbarKeyIndex, rowOffset + 9);
|
||||||
}
|
}
|
||||||
else if (KeyUtil.isKeyDown(row3key.getKey())) {
|
else if (KeyUtil.isKeyDown(row3key.getValue())) {
|
||||||
event.cancel();
|
event.cancel();
|
||||||
swapWithRow(screen, containerSlot, hotbarKeyIndex, rowOffset + 18);
|
swapWithRow(screen, containerSlot, hotbarKeyIndex, rowOffset + 18);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,9 +2,9 @@ package me.retucio.sputnik.module.modules.player;
|
|||||||
|
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.module.settings.OptionSetting;
|
import me.retucio.sputnik.module.setting.settings.OptionSetting;
|
||||||
import me.retucio.sputnik.util.Lists;
|
import me.retucio.sputnik.util.Lists;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
@@ -16,10 +16,10 @@ import net.minecraft.util.math.Direction;
|
|||||||
|
|
||||||
public class Offhand extends Module {
|
public class Offhand extends Module {
|
||||||
|
|
||||||
public OptionSetting<Item> item = addSetting(new OptionSetting<>("ítem", "ítem a equipar",
|
public OptionSetting<Item> item = sgGeneral.add(new OptionSetting<>("ítem", "ítem a equipar",
|
||||||
Lists.itemList, Items.TOTEM_OF_UNDYING, Lists.itemNames));
|
Lists.itemList, Items.TOTEM_OF_UNDYING, Lists.itemNames));
|
||||||
public NumberSetting delaySetting = addSetting(new NumberSetting("delay", "delay del cambiazo (en ticks)", 0, 0, 20, 1));
|
public NumberSetting delaySetting = sgGeneral.add(new NumberSetting("delay", "delay del cambiazo (en ticks)", 0, 0, 20, 1));
|
||||||
public BooleanSetting override = addSetting(new BooleanSetting("anular", "ignora que ya haya un ítem en la mano secundaria", true));
|
public BooleanSetting override = sgGeneral.add(new BooleanSetting("anular", "ignora que ya haya un ítem en la mano secundaria", true));
|
||||||
|
|
||||||
|
|
||||||
private int delay;
|
private int delay;
|
||||||
@@ -46,7 +46,7 @@ public class Offhand extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (holdingItem || (!mc.player.getOffHandStack().isEmpty()
|
if (holdingItem || (!mc.player.getOffHandStack().isEmpty()
|
||||||
&& !override.isEnabled()))
|
&& !override.getValue()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mc.player.playerScreenHandler == mc.player.currentScreenHandler) {
|
if (mc.player.playerScreenHandler == mc.player.currentScreenHandler) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package me.retucio.sputnik.module.modules.player;
|
|||||||
import me.retucio.sputnik.mixin.accessor.KeyBindingAccessor;
|
import me.retucio.sputnik.mixin.accessor.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.settings.ListSetting;
|
import me.retucio.sputnik.module.setting.settings.ListSetting;
|
||||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||||
import me.retucio.sputnik.util.KeyUtil;
|
import me.retucio.sputnik.util.KeyUtil;
|
||||||
import me.retucio.sputnik.util.Lists;
|
import me.retucio.sputnik.util.Lists;
|
||||||
@@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class UIMove extends Module {
|
public class UIMove extends Module {
|
||||||
|
|
||||||
public ListSetting<ScreenHandlerType<?>> screens = addSetting(new ListSetting<>("interfaces", "interfaces en las que te podrás mover",
|
public ListSetting<ScreenHandlerType<?>> screens = sgGeneral.add(new ListSetting<>("interfaces", "interfaces en las que te podrás mover",
|
||||||
Lists.screenList, Lists.allTrue(Lists.screenList), Lists.screenNames));
|
Lists.screenList, Lists.allTrue(Lists.screenList), Lists.screenNames));
|
||||||
|
|
||||||
private List<KeyBinding> movementKeys;
|
private List<KeyBinding> movementKeys;
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package me.retucio.sputnik.module.modules.player;
|
|||||||
|
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.OptionSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.OptionSetting;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import me.retucio.sputnik.util.Lists;
|
import me.retucio.sputnik.util.Lists;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -21,16 +22,19 @@ import java.util.List;
|
|||||||
|
|
||||||
public class WarnLowDurability extends Module {
|
public class WarnLowDurability extends Module {
|
||||||
|
|
||||||
public NumberSetting limitPercentage = addSetting(new NumberSetting("porcentaje", "porcentaje de durabilidad restante a la que se te avisa",
|
SettingGroup sgWarn = addSg(new SettingGroup("aviso", true));
|
||||||
|
SettingGroup sgSound = addSg(new SettingGroup("sonido", true));
|
||||||
|
|
||||||
|
public NumberSetting limitPercentage = sgGeneral.add(new NumberSetting("porcentaje", "porcentaje de durabilidad restante a la que se te avisa",
|
||||||
5, 1, 100, 1));
|
5, 1, 100, 1));
|
||||||
|
|
||||||
public BooleanSetting message = addSetting(new BooleanSetting("enviar mensaje", "enviar un mensaje para alertar al usuario", true));
|
public BooleanSetting message = sgWarn.add(new BooleanSetting("enviar mensaje", "enviar un mensaje para alertar al usuario", true));
|
||||||
|
public BooleanSetting playSound = sgWarn.add(new BooleanSetting("reproducir sonido", "reproducir un sonido para alertar al usuario", true));
|
||||||
|
|
||||||
public BooleanSetting playSound = addSetting(new BooleanSetting("reproducir sonido", "reproducir un sonido para alertar al usuario", true));
|
public OptionSetting<SoundEvent> sound = sgSound.add(new OptionSetting<>("sonido", "qué sonido reproducir",
|
||||||
public OptionSetting<SoundEvent> sound = addSetting(new OptionSetting<>("sonido", "qué sonido reproducir",
|
|
||||||
Lists.soundList, SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), Lists.soundNames));
|
Lists.soundList, SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), Lists.soundNames));
|
||||||
public NumberSetting volume = addSetting(new NumberSetting("volumen", "volumen del sonido", 70, 0, 125, 1));
|
public NumberSetting volume = sgSound.add(new NumberSetting("volumen", "volumen del sonido", 70, 0, 125, 1));
|
||||||
public NumberSetting pitch = addSetting(new NumberSetting("frecuencia", "altura del sonido", 70, 0, 125, 1));
|
public NumberSetting pitch = sgSound.add(new NumberSetting("frecuencia", "altura del sonido", 70, 0, 125, 1));
|
||||||
|
|
||||||
private final List<ItemStack> warned = new ArrayList<>();
|
private final List<ItemStack> warned = new ArrayList<>();
|
||||||
private float prevPercentage = -1;
|
private float prevPercentage = -1;
|
||||||
@@ -56,7 +60,7 @@ public class WarnLowDurability extends Module {
|
|||||||
float percentage = (1 - (float) stack.getDamage() / stack.getMaxDamage()) * 100;
|
float percentage = (1 - (float) stack.getDamage() / stack.getMaxDamage()) * 100;
|
||||||
|
|
||||||
if (percentage <= limitPercentage.getValue() && percentage < prevPercentage) {
|
if (percentage <= limitPercentage.getValue() && percentage < prevPercentage) {
|
||||||
if (playSound.isEnabled())
|
if (playSound.getValue())
|
||||||
mc.world.playSound(mc.player, mc.player.getBlockPos(),
|
mc.world.playSound(mc.player, mc.player.getBlockPos(),
|
||||||
sound.getValue(),
|
sound.getValue(),
|
||||||
SoundCategory.AMBIENT,
|
SoundCategory.AMBIENT,
|
||||||
@@ -64,7 +68,7 @@ public class WarnLowDurability extends Module {
|
|||||||
toExponential(pitch)
|
toExponential(pitch)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (message.isEnabled()) {
|
if (message.getValue()) {
|
||||||
String customName = stack.getCustomName() == null ? "" : " \"" + stack.getCustomName().getString() + "\"";
|
String customName = stack.getCustomName() == null ? "" : " \"" + stack.getCustomName().getString() + "\"";
|
||||||
Text text = Text.literal(Formatting.AQUA + stack.getItemName().getString()
|
Text text = Text.literal(Formatting.AQUA + stack.getItemName().getString()
|
||||||
+ Formatting.GREEN + customName + Formatting.RESET
|
+ Formatting.GREEN + customName + Formatting.RESET
|
||||||
|
|||||||
@@ -1,39 +1,109 @@
|
|||||||
package me.retucio.sputnik.module.modules.render;
|
package me.retucio.sputnik.module.modules.render;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.RenderWorldEvent;
|
import me.retucio.sputnik.event.events.Render3DEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.ListSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
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.Colors;
|
||||||
import me.retucio.sputnik.util.Lists;
|
import me.retucio.sputnik.util.Lists;
|
||||||
import me.retucio.sputnik.util.render.RenderUtil;
|
import me.retucio.sputnik.util.render.RenderUtil;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3i;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
||||||
public class BlockESP extends Module {
|
public class BlockESP extends Module {
|
||||||
|
|
||||||
public ListSetting<Block> blocks = addSetting(new ListSetting<>("bloques", "bloques a resaltar",
|
SettingGroup sgSearch = addSg(new SettingGroup("búsqueda", true));
|
||||||
Lists.blockList, Lists.allFalse(Lists.blockList), Lists.blockNames));
|
SettingGroup sgOulines = addSg(new SettingGroup("contorno", true));
|
||||||
|
SettingGroup sgFilling = addSg(new SettingGroup("relleno", true));
|
||||||
|
|
||||||
public NumberSetting radius = addSetting(new NumberSetting("radio", "radio de búsqueda de bloques", 24, 2, 128, 1));
|
|
||||||
|
|
||||||
public BooleanSetting outlines = addSetting(new BooleanSetting("contorno", "renderizar contorno de bloques", true));
|
// bloques
|
||||||
public ColorSetting outlineColor = addSetting(new ColorSetting("color del contorno", "color del contorno", Colors.CELESTE, false));
|
|
||||||
public NumberSetting lineWidth = addSetting(new NumberSetting("grosor del contorno", "grosor de las líneas del contorno", 1, 1, 5, 0.2));
|
|
||||||
|
|
||||||
public BooleanSetting fillings = addSetting(new BooleanSetting("relleno", "renderizar relleno de bloques", true));
|
public ListSetting<Block> blocks = sgGeneral.add(new ListSetting<>(
|
||||||
public ColorSetting fillingColor = addSetting(new ColorSetting("color del relleno", "color del relleno", new Color(57, 177, 215, 67), false));
|
"bloques", "bloques a resaltar",
|
||||||
|
Lists.blockList,
|
||||||
|
Lists.allFalse(Lists.blockList),
|
||||||
|
Lists.blockNames
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting maxBlocks = sgGeneral.add(new NumberSetting(
|
||||||
|
"máx. bloques", "número máximo de bloques a resaltar",
|
||||||
|
500, 1, 2000, 1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// búsqueda
|
||||||
|
|
||||||
|
public NumberSetting radius = sgSearch.add(new NumberSetting(
|
||||||
|
"radio", "radio de búsqueda de bloques",
|
||||||
|
24, 2, 128, 1
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting searchInterval = sgSearch.add(new NumberSetting(
|
||||||
|
"intervalo", "intervalo de búsqueda en ticks",
|
||||||
|
10, 1, 40, 1
|
||||||
|
));
|
||||||
|
|
||||||
|
public BooleanSetting asyncSearch = sgSearch.add(new BooleanSetting(
|
||||||
|
"búsqueda asíncrona", "busca los bloques en un hilo separado (optimización)",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting distanceToMove = sgSearch.add(new NumberSetting(
|
||||||
|
"distancia a moverse", "distancia a moverse antes de actualizar los bloques",
|
||||||
|
3, 0, 10, 0.1
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// contorno
|
||||||
|
|
||||||
|
public BooleanSetting outlines = sgOulines.add(new BooleanSetting(
|
||||||
|
"contorno", "renderizar contorno de bloques",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public ColorSetting outlineColor = sgOulines.add(new ColorSetting(
|
||||||
|
"color del contorno", "color del contorno",
|
||||||
|
Colors.CELESTE, false
|
||||||
|
));
|
||||||
|
|
||||||
|
public NumberSetting lineWidth = sgOulines.add(new NumberSetting(
|
||||||
|
"grosor del contorno", "grosor de las líneas del contorno",
|
||||||
|
1, 1, 5, 0.2
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// relleno
|
||||||
|
|
||||||
|
public BooleanSetting fillings = sgFilling.add(new BooleanSetting(
|
||||||
|
"relleno", "renderizar relleno de bloques",
|
||||||
|
true
|
||||||
|
));
|
||||||
|
|
||||||
|
public ColorSetting fillingColor = sgFilling.add(new ColorSetting(
|
||||||
|
"color del relleno", "color del relleno",
|
||||||
|
new Color(57, 177, 215, 67), false
|
||||||
|
));
|
||||||
|
|
||||||
|
// caché
|
||||||
|
private final Map<BlockPos, VoxelShape> cachedBlocks = new ConcurrentHashMap<>();
|
||||||
|
private final Set<Block> enabledBlocks = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
|
private BlockPos lastPlayerPos = null;
|
||||||
|
private int lastRadius = -1;
|
||||||
|
private int searchTimer = 0;
|
||||||
|
private boolean isSearching = false;
|
||||||
|
|
||||||
|
|
||||||
public BlockESP() {
|
public BlockESP() {
|
||||||
@@ -41,61 +111,166 @@ public class BlockESP extends Module {
|
|||||||
"te muestra la posición de cierto tipo de bloque renderizando una caja con su forma",
|
"te muestra la posición de cierto tipo de bloque renderizando una caja con su forma",
|
||||||
Category.RENDER);
|
Category.RENDER);
|
||||||
|
|
||||||
|
blocks.onUpdate(v ->
|
||||||
|
updateEnabledBlocks()
|
||||||
|
);
|
||||||
|
|
||||||
outlines.onUpdate(v -> {
|
outlines.onUpdate(v -> {
|
||||||
outlineColor.setVisible(v);
|
outlineColor.setVisible(v);
|
||||||
lineWidth.setVisible(v);
|
lineWidth.setVisible(v);
|
||||||
});
|
});
|
||||||
|
|
||||||
fillings.onUpdate(v -> fillingColor.setVisible(v));
|
fillings.onUpdate(v ->
|
||||||
|
fillingColor.setVisible(v)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
cachedBlocks.clear();
|
||||||
|
enabledBlocks.clear();
|
||||||
|
updateEnabledBlocks();
|
||||||
|
searchTimer = 0;
|
||||||
|
|
||||||
|
super.onEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
cachedBlocks.clear();
|
||||||
|
enabledBlocks.clear();
|
||||||
|
|
||||||
|
super.onDisable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRenderWorld(RenderWorldEvent event) {
|
public void onRenderWorld(Render3DEvent event) {
|
||||||
if (mc.player == null || mc.world == null) return;
|
if (mc.player == null || mc.world == null) return;
|
||||||
|
|
||||||
for (Block block : blocks.getOptions()) {
|
// aplicar el intervalo
|
||||||
if (blocks.isEnabled(block)) {
|
if (searchTimer++ >= searchInterval.getIntValue()) {
|
||||||
List<BlockPos> blocksToHighlight = getNearbyBlocks(block);
|
searchTimer = 0;
|
||||||
for (BlockPos pos : blocksToHighlight) {
|
searchBlocks();
|
||||||
if (outlines.isEnabled()) {
|
}
|
||||||
RenderUtil.drawVoxelShapeOutline(
|
|
||||||
event.getMatrices(),
|
Vec3d cameraPos = mc.gameRenderer.getCamera().getCameraPos();
|
||||||
getVoxelShape(pos),
|
|
||||||
pos,
|
int rendered = 0;
|
||||||
outlineColor.getColor(),
|
Iterator<Map.Entry<BlockPos, VoxelShape>> iterator = cachedBlocks.entrySet().iterator();
|
||||||
lineWidth.getFloatValue(),
|
|
||||||
false);
|
while (iterator.hasNext() && rendered < maxBlocks.getIntValue()) {
|
||||||
}
|
Map.Entry<BlockPos, VoxelShape> entry = iterator.next();
|
||||||
if (fillings.isEnabled()) {
|
BlockPos pos = entry.getKey();
|
||||||
RenderUtil.drawVoxelShapeFilled(
|
VoxelShape shape = entry.getValue();
|
||||||
event.getMatrices(),
|
|
||||||
getVoxelShape(pos),
|
if (!isValidBlock(pos)) {
|
||||||
pos,
|
iterator.remove();
|
||||||
fillingColor.getColor(),
|
continue;
|
||||||
false);
|
}
|
||||||
|
|
||||||
|
// validación de distancia
|
||||||
|
double distance = Math.sqrt(pos.getSquaredDistance(cameraPos));
|
||||||
|
if (distance > radius.getIntValue()) {
|
||||||
|
iterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// renderizado
|
||||||
|
if (outlines.getValue()) {
|
||||||
|
Color color = outlineColor.getValue();
|
||||||
|
RenderUtil.drawVoxelShapeOutline(
|
||||||
|
event.getMatrices(),
|
||||||
|
shape,
|
||||||
|
pos,
|
||||||
|
color,
|
||||||
|
lineWidth.getFloatValue(),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fillings.getValue()) {
|
||||||
|
Color color = fillingColor.getValue();
|
||||||
|
RenderUtil.drawVoxelShapeFilled(
|
||||||
|
event.getMatrices(),
|
||||||
|
shape,
|
||||||
|
pos,
|
||||||
|
color,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
|
rendered++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateEnabledBlocks() {
|
||||||
|
enabledBlocks.clear();
|
||||||
|
enabledBlocks.addAll(blocks.getEnabledOptions());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void searchBlocks() {
|
||||||
|
if (mc.player == null || mc.world == null || enabledBlocks.isEmpty()) return;
|
||||||
|
|
||||||
|
BlockPos playerPos = mc.player.getBlockPos();
|
||||||
|
int currentRadius = radius.getIntValue();
|
||||||
|
|
||||||
|
// si el jugador no se ha movido mucho, omitir la búsqueda
|
||||||
|
if (lastPlayerPos != null && lastRadius == currentRadius &&
|
||||||
|
playerPos.getSquaredDistance(lastPlayerPos) < (distanceToMove.getValue() * distanceToMove.getIntValue())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastPlayerPos = playerPos;
|
||||||
|
lastRadius = currentRadius;
|
||||||
|
|
||||||
|
// multithreading
|
||||||
|
if (asyncSearch.getValue()) {
|
||||||
|
if (isSearching) return;
|
||||||
|
|
||||||
|
isSearching = true;
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
performBlockSearch(playerPos, currentRadius);
|
||||||
|
} finally {
|
||||||
|
isSearching = false;
|
||||||
|
}
|
||||||
|
}, "sputnik-blockESP-search").start();
|
||||||
|
} else {
|
||||||
|
performBlockSearch(playerPos, currentRadius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// buscar los bloques
|
||||||
|
private void performBlockSearch(BlockPos center, int radius) {
|
||||||
|
Map<BlockPos, VoxelShape> newBlocks = new HashMap<>();
|
||||||
|
int radiusSq = radius * radius;
|
||||||
|
|
||||||
|
for (int x = -radius; x <= radius; x++) {
|
||||||
|
for (int y = -radius; y <= radius; y++) {
|
||||||
|
for (int z = -radius; z <= radius; z++) {
|
||||||
|
if (x*x + y*y + z*z > radiusSq) continue;
|
||||||
|
|
||||||
|
BlockPos pos = center.add(x, y, z);
|
||||||
|
Block block = mc.world.getBlockState(pos).getBlock();
|
||||||
|
|
||||||
|
if (enabledBlocks.contains(block)) {
|
||||||
|
VoxelShape shape = mc.world.getBlockState(pos).getOutlineShape(mc.world, pos);
|
||||||
|
if (!shape.isEmpty()) {
|
||||||
|
newBlocks.put(pos.toImmutable(), shape);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// actualizar caché
|
||||||
|
cachedBlocks.keySet().retainAll(newBlocks.keySet());
|
||||||
|
cachedBlocks.putAll(newBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<BlockPos> getNearbyBlocks(Block block) {
|
// verificar que el bloque sea válido
|
||||||
List<BlockPos> blockPosList = new ArrayList<>();
|
@SuppressWarnings("deprecation")
|
||||||
|
private boolean isValidBlock(BlockPos pos) {
|
||||||
for (int i = -radius.getIntValue(); i < radius.getIntValue(); i++) {
|
if (mc.world == null || !mc.world.isChunkLoaded(pos)) return false;
|
||||||
for (int j = -radius.getIntValue(); j < radius.getIntValue(); j++) {
|
Block block = mc.world.getBlockState(pos).getBlock();
|
||||||
for (int k = -radius.getIntValue(); k < radius.getIntValue(); k++) {
|
return enabledBlocks.contains(block);
|
||||||
BlockPos pos = mc.player.getBlockPos().add(new Vec3i(i, j, k));
|
|
||||||
if (mc.world.getBlockState(pos).getBlock() == block) {
|
|
||||||
blockPosList.add(pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return blockPosList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private VoxelShape getVoxelShape(BlockPos pos) {
|
|
||||||
return mc.world.getBlockState(pos).getOutlineShape(mc.world, pos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,9 @@ package me.retucio.sputnik.module.modules.render;
|
|||||||
|
|
||||||
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.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import me.retucio.sputnik.util.Colors;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
@@ -12,8 +14,21 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class BlockOutline extends Module {
|
public class BlockOutline extends Module {
|
||||||
|
|
||||||
public ColorSetting color = addSetting(new ColorSetting("color", "color del contorno de los bloques",
|
public ColorSetting color = sgGeneral.add(new ColorSetting(
|
||||||
new Color(0, 0, 0, 102), true));
|
"color",
|
||||||
|
"color del contorno de los bloques",
|
||||||
|
Colors.mainColor,
|
||||||
|
true)
|
||||||
|
);
|
||||||
|
|
||||||
|
public NumberSetting lineWidth = sgGeneral.add(new NumberSetting(
|
||||||
|
"grosor",
|
||||||
|
"grosor de las líneas",
|
||||||
|
0.5,
|
||||||
|
0.1,
|
||||||
|
10,
|
||||||
|
0.1
|
||||||
|
));
|
||||||
|
|
||||||
public BlockOutline() {
|
public BlockOutline() {
|
||||||
super("contorno",
|
super("contorno",
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package me.retucio.sputnik.module.modules.render;
|
package me.retucio.sputnik.module.modules.render;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.SubscribeEvent;
|
||||||
import me.retucio.sputnik.event.events.RenderWorldEvent;
|
import me.retucio.sputnik.event.events.Render3DEvent;
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.util.render.RenderUtil;
|
import me.retucio.sputnik.util.render.RenderUtil;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
@@ -18,18 +19,22 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class BreakingProgress extends Module {
|
public class BreakingProgress extends Module {
|
||||||
|
|
||||||
public EnumSetting<BreakMode> breakMode = addSetting(new EnumSetting<>("modo de minado", "elige si el cubo se encoge o se dilata",
|
SettingGroup sgOulines = addSg(new SettingGroup("contorno", true));
|
||||||
|
SettingGroup sgFilling = addSg(new SettingGroup("relleno", true));
|
||||||
|
|
||||||
|
public EnumSetting<BreakMode> breakMode = sgGeneral.add(new EnumSetting<>("modo de minado", "elige si el cubo se encoge o se dilata",
|
||||||
BreakMode.class, BreakMode.INWARDS));
|
BreakMode.class, BreakMode.INWARDS));
|
||||||
|
|
||||||
public BooleanSetting outlines = addSetting(new BooleanSetting("contorno", "renderizar contorno", true));
|
public BooleanSetting outlines = sgOulines.add(new BooleanSetting("contorno", "renderizar contorno", true));
|
||||||
public ColorSetting outlineColor = addSetting(new ColorSetting("color del contorno", "color del contorno",
|
public ColorSetting outlineColor = sgOulines.add(new ColorSetting("color del contorno", "color del contorno",
|
||||||
new Color(0, 255, 0, 200), false));
|
new Color(0, 255, 0, 200), false));
|
||||||
public NumberSetting lineWidth = addSetting(new NumberSetting("grosor de línea", "grosor de las líneas del contorno", 1, 1, 5, 0.1));
|
public NumberSetting lineWidth = sgOulines.add(new NumberSetting("grosor de línea", "grosor de las líneas del contorno", 1, 1, 5, 0.1));
|
||||||
|
|
||||||
public BooleanSetting fillings = addSetting(new BooleanSetting("relleno", "renderizar relleno", true));
|
public BooleanSetting fillings = sgFilling.add(new BooleanSetting("relleno", "renderizar relleno", true));
|
||||||
public ColorSetting fillingColor = addSetting(new ColorSetting("color del relleno", "color del relleno",
|
public ColorSetting fillingColor = sgFilling.add(new ColorSetting("color del relleno", "color del relleno",
|
||||||
new Color(0, 255, 0, 60), false));
|
new Color(0, 255, 0, 60), false));
|
||||||
|
|
||||||
|
|
||||||
public BreakingProgress() {
|
public BreakingProgress() {
|
||||||
super("progreso de minado",
|
super("progreso de minado",
|
||||||
"te muestra el progreso de minado de un bloque de manera más visible",
|
"te muestra el progreso de minado de un bloque de manera más visible",
|
||||||
@@ -37,7 +42,7 @@ public class BreakingProgress extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRenderWorld(RenderWorldEvent event) {
|
public void onRenderWorld(Render3DEvent event) {
|
||||||
if (mc.interactionManager == null || mc.world == null) return;
|
if (mc.interactionManager == null || mc.world == null) return;
|
||||||
if (!(mc.crosshairTarget instanceof BlockHitResult hitResult)) return;
|
if (!(mc.crosshairTarget instanceof BlockHitResult hitResult)) return;
|
||||||
BlockPos pos = hitResult.getBlockPos();
|
BlockPos pos = hitResult.getBlockPos();
|
||||||
@@ -68,8 +73,8 @@ public class BreakingProgress extends Module {
|
|||||||
centerX + shrunkX, centerY + shrunkZ, centerZ + shrunkZ
|
centerX + shrunkX, centerY + shrunkZ, centerZ + shrunkZ
|
||||||
);
|
);
|
||||||
|
|
||||||
if (outlines.isEnabled()) RenderUtil.drawOutlineBox(event.getMatrices(), scaledBox, outlineColor.getColor(), lineWidth.getFloatValue(), false);
|
if (outlines.getValue()) RenderUtil.drawOutlineBox(event.getMatrices(), scaledBox, outlineColor.getValue(), lineWidth.getFloatValue(), false);
|
||||||
if (fillings.isEnabled()) RenderUtil.drawFilledBox(event.getMatrices(), scaledBox, fillingColor.getColor(), false);
|
if (fillings.getValue()) RenderUtil.drawFilledBox(event.getMatrices(), scaledBox, fillingColor.getValue(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BreakMode {
|
public enum BreakMode {
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ package me.retucio.sputnik.module.modules.render;
|
|||||||
|
|
||||||
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.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
|
import me.retucio.sputnik.util.Colors;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
@@ -15,14 +17,17 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class CritsPlus extends Module {
|
public class CritsPlus extends Module {
|
||||||
|
|
||||||
public ColorSetting color = addSetting(new ColorSetting("color", "color de las partículas", new Color(0, 0, 255, 255), false));
|
SettingGroup sgAppearance = addSg(new SettingGroup("aspecto", true));
|
||||||
|
SettingGroup sgBehaviour = addSg(new SettingGroup("funcionamiento", true));
|
||||||
|
|
||||||
public NumberSetting scale = addSetting(new NumberSetting("escala", "tamaño", 1, 0, 2, 0.05));
|
public ColorSetting color = sgAppearance.add(new ColorSetting("color", "color de las partículas", Colors.mainColor, false));
|
||||||
public NumberSetting multiplier = addSetting(new NumberSetting("múltiplo", "número por el que multiplicar la cantidad de partículas generadas", 1, 0, 10, 0.1));
|
public NumberSetting scale = sgAppearance.add(new NumberSetting("escala", "tamaño", 1, 0, 2, 0.05));
|
||||||
public NumberSetting velocityMultipler = addSetting(new NumberSetting("dispersión", "multiplicador de la velocidad de dispersión", 1, 0, 10, 0.1));
|
public NumberSetting multiplier = sgAppearance.add(new NumberSetting("múltiplo", "número por el que multiplicar la cantidad de partículas generadas", 1, 0, 10, 0.1));
|
||||||
public NumberSetting gravity = addSetting(new NumberSetting("gravedad", "multiplicador de fuerza de gravedad", 1, 0, 10, 0.1));
|
|
||||||
public NumberSetting maxAge = addSetting(new NumberSetting("vida máxima", "cuánto persiste la partícula", 10, 0, 50, 1));
|
public NumberSetting velocityMultipler = sgBehaviour.add(new NumberSetting("dispersión", "multiplicador de la velocidad de dispersión", 1, 0, 10, 0.1));
|
||||||
public BooleanSetting collide = addSetting(new BooleanSetting("colisionar", "colisionar con bloques", false));
|
public NumberSetting gravity = sgBehaviour.add(new NumberSetting("gravedad", "multiplicador de fuerza de gravedad", 1, 0, 10, 0.1));
|
||||||
|
public NumberSetting maxAge = sgBehaviour.add(new NumberSetting("vida máxima", "cuánto persiste la partícula", 10, 0, 50, 1));
|
||||||
|
public BooleanSetting collide = sgBehaviour.add(new BooleanSetting("colisionar", "colisionar con bloques", false));
|
||||||
|
|
||||||
public CritsPlus() {
|
public CritsPlus() {
|
||||||
super("críticos",
|
super("críticos",
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package me.retucio.sputnik.module.modules.render;
|
|||||||
import me.retucio.sputnik.mixin.accessor.OverlayTextureAccessor;
|
import me.retucio.sputnik.mixin.accessor.OverlayTextureAccessor;
|
||||||
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.settings.ColorSetting;
|
import me.retucio.sputnik.module.setting.settings.ColorSetting;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.util.Colors;
|
||||||
import net.minecraft.client.texture.NativeImage;
|
import net.minecraft.client.texture.NativeImage;
|
||||||
import net.minecraft.client.texture.NativeImageBackedTexture;
|
import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||||
|
|
||||||
@@ -16,7 +17,12 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class DamageOverlay extends Module {
|
public class DamageOverlay extends Module {
|
||||||
|
|
||||||
public ColorSetting colorSetting = addSetting(new ColorSetting("color", "color", new Color(255, 0, 0, 77), false));
|
public ColorSetting colorSetting = sgGeneral.add(new ColorSetting(
|
||||||
|
"color",
|
||||||
|
"color",
|
||||||
|
Colors.mainColor,
|
||||||
|
false
|
||||||
|
));
|
||||||
|
|
||||||
private NativeImageBackedTexture texture = null;
|
private NativeImageBackedTexture texture = null;
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 183 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user