Compare commits

...
4 Commits
Author SHA1 Message Date
retuci0 9b6d037b6c v3.0 2026-02-01 13:46:01 +01:00
retuci0 86594f1ca3 v2.9 2026-01-18 22:53:21 +01:00
retuci0 f074f05c51 v2.8 2026-01-17 17:12:54 +01:00
retuci0 436b79fd2b v2.7 2026-01-17 00:33:24 +01:00
216 changed files with 5401 additions and 1391 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# jenny's mod 2 100% real
mod para Minecraft Fabric 1.21.10 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
mod para Minecraft Fabric 1.21.11 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
## instalación
+14 -23
View File
@@ -1,6 +1,6 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
}
version = project.mod_version
@@ -11,20 +11,21 @@ base {
}
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {
name = "FDD Maven"
url = "https://maven.firstdark.dev/releases"
}
}
dependencies {
// To change the versions see the gradle.properties file
// mc
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
// otros
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
}
loom {
@@ -44,11 +45,6 @@ tasks.withType(JavaCompile).configureEach {
}
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
targetCompatibility = JavaVersion.VERSION_21
}
@@ -57,11 +53,12 @@ jar {
inputs.property "archivesName", project.base.archivesName
from("LICENSE") {
rename { "${it}_${inputs.properties.archivesName}"}
rename {
"${it}_${inputs.properties.archivesName}"
}
}
}
// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
@@ -70,11 +67,5 @@ publishing {
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
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.
}
repositories {}
}
+23 -14
View File
@@ -1,27 +1,36 @@
# v2.6
# v3.0
## novedades
### adiciones
- categoría de combate
- layouts de teclado (en_us y es_es) (fuck azerty)
- comando `$config` para abrir el marco de ajustes de un módulo
- elemento del hud que muestra la rotación de la cámara del jugador
### adiciones
#### módulos nuevos:
- fuentes: cambia la tipografía que usa todo el juego a una custom
- escalones: actúa con la altura deseada como si se estuviesen subiendo escalones
- escalones inversos: escalones, pabajo
- partículas: genera particulas artificiales
- colocar en aire: te permite colocar bloques sin soporte alguno
- tobillos fuertes: evita el daño de caída, ya sea por medio de paquetes o amortiguándola con un cubo de agua, si este está disponible
- don quijote: te acelera para inflingir cantidades importantes de daño con la lanza
- auto herramienta: cambia automáticamente a la herramienta más veloz disponible para el bloque seleccionado
- autismo: da vueltas
- anti hambre: previene el hambre, cancelando los paquetes que le indican al server que empiezas a esprintar
- trayectoria: preve la trayectoria de los proyectiles (maomeno, aún lo tengo que ajustar un poco)
- hotkeys inv. creativo: te permite usar las teclas de la hotbar correctamente en la pestaña de búsqueda, por ejemplo, si tienes el slot 5 en la E, al posicionar el cursor sobre un stack del resultado de búsqueda, y darle a la E, en vez de escribir una E, actúa como las teclas del 1-9
- auto pesca: pesca por ti
#### comandos nuevos:
- `$plugins`: trata de buscar plugins del server al que estás conectado mediante la búsqueda de comandos no vanilla
- `$clickslot`: simula un clic en un slot específico, también se especifica el botón del ratón y la acción
- `$wait`: espera un delay determinado antes de enviar un mensaje / ejecutar un comando
- `$repeat`: repite un comando o mensaje x veces
### arreglos / mejoras
- ahora puedes cambiar el grosor de las líneas del contorno de los bloques
- arreglada la compatibilidad con meteor client
- optimizado y mejorado superposición de luz y resaltado de bloques
- ahora, en los marcos de seleccion única, en el tooltip de cada opción dice "seleccionar" en lugar de "incluir"
- ahora precoz también tiene una opción de reducir el cooldown al minar bloques
- delfín ahora funciona mejor (*ruidos de delfín*)
- barco volador ahora usa el ajuste de velocidad vertical
- escalones inversos ahora usa el ajuste de velocidad
- ahora puedes ver el tiempo restante hasta que una entidad de tnt explote
## problemas reconocidos
+3
View File
@@ -7,6 +7,9 @@ Trouser Streak: https://github.com/etianl/Trouser-Streak
No More Purple: https://github.com/Pepperoni-Jabroni/NoMorePurple/
bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack
elytra-recast: https://github.com/InLieuOfLuna/elytra-recast/
SpearHax: https://github.com/etianl/spearHax/
ProjectileTrajectoryPreview: https://github.com/maDU59/ProjectilesTrajectoryPreview
DupersUnited public addon: https://discord.gg/dupes | https://dupers.wtf
probablemente más pero como tengo demencia se me olvida
si quieres que te acredite o quite tu código de mi mod, mándame un mensaje en discord (username: retucio) y sin problemas :)
+1 -1
View File
@@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT
fabric_api_version=0.140.2+1.21.11
mod_version=2.6
mod_version=3.0
maven_group=me.retucio
archives_base_name=sputnik
Vendored Regular → Executable
View File
File mode changed.
@@ -19,6 +19,7 @@ import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.client.HUD;
import me.retucio.sputnik.ui.hud.HudRenderer;
import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.hud.HudEditorScreen;
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
@@ -31,8 +32,10 @@ import me.retucio.sputnik.ui.widgets.Button;
import me.retucio.sputnik.util.*;
import me.retucio.sputnik.util.KeyUtil;
import me.retucio.sputnik.util.render.DrawUtil;
import me.retucio.sputnik.util.render.Pipelines;
import me.retucio.sputnik.util.render.RenderUtil;
import me.retucio.sputnik.util.render.Textures;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
@@ -92,6 +95,8 @@ public class Sputnik implements ClientModInitializer {
Lists.init();
Textures.init();
CapeManager.INSTANCE = new CapeManager();
EVENT_BUS.post(new LoadCapeManagerEvent());
@@ -105,6 +110,8 @@ public class Sputnik implements ClientModInitializer {
HudEditorScreen.INSTANCE = new HudEditorScreen();
EVENT_BUS.post(new LoadClickGUIEvent());
mc.execute(HudRenderer::init);
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
EVENT_BUS.post(new ShutdownEvent());
}));
@@ -120,6 +127,7 @@ public class Sputnik implements ClientModInitializer {
}
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
mc.getWindow().setTitle(ClientSettingsFrame.guiSettings.windowTitle.getValue());
}
@@ -195,7 +203,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()
private void handleHudEditorKey(int key, boolean anyFocused) {
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 (!hud.isEnabled()) {
@@ -32,17 +32,21 @@ public class CommandManager {
public static void registerCommands() {
addCommand(new BindCommand());
addCommand(new ClickSlotCommand());
addCommand(new ConfigCommand());
addCommand(new CopyScreenshotCommand());
addCommand(new EnderChestCommand());
addCommand(new GarbageCleanerCommand());
addCommand(new PeekCommand());
addCommand(new PluginsCommand());
addCommand(new PrefixCommand());
addCommand(new PurgeCommand());
addCommand(new RepeatCommand());
addCommand(new SaveScreenshotCommand());
addCommand(new SendCommand());
addCommand(new SpectateCommand());
addCommand(new ToggleCommand());
addCommand(new WaitCommand());
commands.sort(Comparator.comparing(Command::getName));
@@ -0,0 +1,46 @@
package me.retucio.sputnik.command.args;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
public class EnumArgumentType<T extends Enum<T>> implements ArgumentType<T> {
private static final DynamicCommandExceptionType NO_SUCH_TYPE = new DynamicCommandExceptionType((value) -> Text.of(" argumento inválido: " + value));
private final T[] values;
public EnumArgumentType(T defaultValue) {
this.values = defaultValue.getDeclaringClass().getEnumConstants();
}
public static <T extends Enum<T>> EnumArgumentType<T> enumArgument(T defaultValue) {
return new EnumArgumentType<>(defaultValue);
}
public static <T extends Enum<T>> T getEnum(CommandContext<?> context, String name, T defaultValue) {
return context.getArgument(name, defaultValue.getDeclaringClass());
}
public T parse(StringReader reader) throws CommandSyntaxException {
String argument = reader.readString();
return Arrays.stream(this.values)
.filter((value) -> value.toString().equals(argument))
.findFirst()
.orElseThrow(() -> NO_SUCH_TYPE.create(argument)
);
}
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
return CommandSource.suggestMatching(Arrays.stream(this.values).map(e -> e.toString().toLowerCase()), builder);
}
}
@@ -42,7 +42,7 @@ public class BindCommand extends Command {
public static boolean onKeyPress(int key) {
if (listeningModule == null) return false;
KeySetting bind = listeningModule.getBind();
if (bind != null) bind.setKey(key);
if (bind != null) bind.setValue(key);
ChatUtil.info(
Text.of("la tecla " + Formatting.AQUA + KeyUtil.getKeyName(key) + Formatting.RESET +
@@ -0,0 +1,35 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.EnumArgumentType;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.command.CommandSource;
import net.minecraft.screen.slot.SlotActionType;
// https://cdn.discordapp.com/attachments/1456079799045980400/1457154232737206375/dupersunited-public-addon-1.21.11-3.1.3.jar?ex=69735be1&is=69720a61&hm=77fb6faee49762e0a812661f0d98931e89cb725db711c45722249d0efe3b91e4&
public class ClickSlotCommand extends Command {
public ClickSlotCommand() {
super("clickslot", "simula un clic a un slot");
}
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(argument("slot", IntegerArgumentType.integer())
.then(argument("botón", IntegerArgumentType.integer())
.then(argument("acción", EnumArgumentType.enumArgument(SlotActionType.SWAP))
.executes(context -> {
int slot = context.getArgument("slot", Integer.class), button = context.getArgument("botón", Integer.class);
SlotActionType action = context.getArgument("acción", SlotActionType.class);
Screen screen = mc.currentScreen;
int syncId = (screen instanceof GenericContainerScreen gcScreen) ? gcScreen.getScreenHandler().syncId : 0;
mc.interactionManager.clickSlot(syncId, slot, button, action, mc.player);
return SUCCESS;
})
)
)
);
}
}
@@ -5,7 +5,6 @@ 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.module.setting.Setting;
import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
import net.minecraft.command.CommandSource;
@@ -0,0 +1,113 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.tree.CommandNode;
import com.mojang.brigadier.tree.RootCommandNode;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.network.PacketEvent;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.client.network.ClientCommandSource;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.play.CommandTreeS2CPacket;
import java.util.HashSet;
import java.util.Set;
public class PluginsCommand extends Command {
private final Set<String> plugins = new HashSet<>();
private boolean scanning = false;
public PluginsCommand() {
super("plugins", "busca los plugins que tenga el server", "pl", "serverplugins");
Sputnik.EVENT_BUS.subscribe(this);
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
if (mc.isIntegratedServerRunning()) {
ChatUtil.error("estás en un solo jugador");
return SUCCESS;
}
if (scanning) {
ChatUtil.error("calmaaa");
return SUCCESS;
}
plugins.clear();
scanning = true;
findNamespaces();
return SUCCESS;
});
}
private void findNamespaces() {
try {
ClientPlayNetworkHandler networkHandler = mc.getNetworkHandler();
if (networkHandler == null || networkHandler.getCommandDispatcher() == null) {
return;
}
RootCommandNode<ClientCommandSource> root = networkHandler.getCommandDispatcher().getRoot();
root.getChildren().forEach(this::checkNodeForPlugins);
if (!plugins.isEmpty()) {
ChatUtil.info(plugins.size() + " namespace(s) encontrado(s) de comandos:");
plugins.stream()
.sorted()
.forEach(plugin -> ChatUtil.info(" - " + plugin));
}
displayResults();
} catch (Exception e) {
ChatUtil.error("error analizando comandos: " + e.getMessage());
}
}
private void checkNodeForPlugins(CommandNode<ClientCommandSource> node) {
String name = node.getName();
if (name.contains(":")) {
String namespace = name.split(":")[0];
if (!namespace.equalsIgnoreCase("minecraft")
&& !namespace.equalsIgnoreCase("bukkit")
&& !namespace.equalsIgnoreCase("spigot")
&& !namespace.equalsIgnoreCase("paper")) {
plugins.add(namespace);
}
}
node.getChildren().forEach(this::checkNodeForPlugins);
}
@SubscribeEvent
private void onPacketReceive(PacketEvent.Receive event) {
if (!scanning) return;
if (event.getPacket() instanceof CommandTreeS2CPacket) {
findNamespaces();
}
}
private void displayResults() {
if (!plugins.isEmpty()) {
ChatUtil.info(plugins.size() + " plugin(s) encontrado(s)");
plugins.stream().sorted()
.forEach(plugin -> ChatUtil.info(" - " + plugin));
} else {
ChatUtil.warn("sin plugins (probablemente)");
}
scanning = false;
}
}
@@ -0,0 +1,32 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.command.CommandSource;
public class RepeatCommand extends Command {
public RepeatCommand() {
super("repetir", "repite un comando x veces", "repeat");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder
.then(argument("veces", IntegerArgumentType.integer(1))
.then(argument("comando", StringArgumentType.greedyString())
.executes(ctx -> {
int j = ctx.getArgument("veces", Integer.class);
String command = ctx.getArgument("comando", String.class);
for (int i = 0; i < j; i++) {
ChatUtil.simulateChatMessage(command);
}
return SUCCESS;
})
)
);
}
}
@@ -4,7 +4,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.EntityArgumentType;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.event.events.input.KeyEvent;
import me.retucio.sputnik.util.EntityUtil;
import net.minecraft.command.CommandSource;
import net.minecraft.entity.Entity;
@@ -0,0 +1,40 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.command.CommandSource;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class WaitCommand extends Command {
private static final ScheduledExecutorService DELAYED_EXECUTOR = new ScheduledThreadPoolExecutor(2);
public WaitCommand() {
super("wait", "espera un tiempo determinado antes de ejecutar otro comando", "esperar", "sleep", "delay");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder
.then(argument("delay", IntegerArgumentType.integer(0))
.then(argument("comando", StringArgumentType.greedyString())
.executes(ctx -> {
int delay = ctx.getArgument("delay", Integer.class);
String command = ctx.getArgument("comando", String.class);
DELAYED_EXECUTOR.schedule(() -> ChatUtil.simulateChatMessage(command), delay, TimeUnit.MILLISECONDS);
return SUCCESS;
})
)
);
}
}
@@ -57,9 +57,9 @@ public class ClientConfig {
// guardar ajustes con su respectivo tipo de valor, en formato "nombreMódulo:nombreAjuste"
Object value = null;
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 KeySetting k: value = k.getKey(); break;
case KeySetting k: value = k.getValue(); break;
case NumberSetting n: value = n.getValue(); break;
case StringSetting s: value = s.getValue(); break;
case ListSetting l: value = l.getConfigValues(); break;
@@ -107,7 +107,7 @@ public class ConfigManager {
save();
}
public static void setSetting(Setting setting, Object value) {
public static void setSetting(Setting<?> setting, Object value) {
ensureConfig();
config.settings.put(getSettingKey(setting), value);
save();
@@ -150,7 +150,7 @@ public class ConfigManager {
// ------------------ APLICAR AJUSTES ------------------
@SuppressWarnings({"rawtypes", "unchecked"})
public static void applySetting(Module parent, Setting setting) {
public static void applySetting(Module parent, Setting<?> setting) {
String key = getSettingKey(setting);
if (!config.settings.containsKey(key)) return;
@@ -249,7 +249,7 @@ public class ConfigManager {
private static void applyBooleanSetting(BooleanSetting setting, Object value) {
if (value instanceof Boolean) {
setting.setEnabled((Boolean) value);
setting.setValue((Boolean) value);
}
}
@@ -275,9 +275,9 @@ public class ConfigManager {
private static void applyKeySetting(KeySetting setting, Object value) {
if (value instanceof Double) {
setting.setKey(((Double) value).intValue());
setting.setValue(((Double) value).intValue());
} else if (value instanceof Integer) {
setting.setKey((Integer) value);
setting.setValue((Integer) value);
}
}
@@ -291,7 +291,7 @@ public class ConfigManager {
convertedValues.put(option, booleanValue instanceof Boolean && (Boolean) booleanValue);
}
setting.setValues(convertedValues);
setting.setValue(convertedValues);
}
}
@@ -342,8 +342,8 @@ public class ConfigManager {
if (config == null) config = new ClientConfig();
}
private static String getSettingKey(Setting setting) {
return setting.getSg().getModule().getName() + ":" + setting.getName();
private static String getSettingKey(Setting<?> setting) {
return setting.getSg().getModule().getName() + ":" + setting.getTrueName();
}
public static boolean hasLoaded() {
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import net.minecraft.text.ClickEvent;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.event.Event;
@@ -0,0 +1,24 @@
package me.retucio.sputnik.event.events.interact;
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;
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.entity.Entity;
@@ -0,0 +1,43 @@
package me.retucio.sputnik.event.events.interact;
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,28 @@
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.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;
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.util.math.BlockPos;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.item.ItemStack;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.entity.Entity;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.gui.screen.Screen;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.util.Hand;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.item.ItemStack;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import net.minecraft.entity.Entity;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.network.ServerInfo;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.world.ClientWorld;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.event.Stage;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.gui.hud.MessageIndicator;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import net.minecraft.entity.Entity;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.option.Perspective;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.gui.DrawContext;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.render.Camera;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.util.math.MatrixStack;
@@ -0,0 +1,30 @@
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
public class RenderBlockOutlineEvent extends Event {
private int color;
private float lineWidth;
public RenderBlockOutlineEvent(int color, float lineWidth) {
this.color = color;
this.lineWidth = lineWidth;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public float getLineWidth() {
return lineWidth;
}
public void setLineWidth(float lineWidth) {
this.lineWidth = lineWidth;
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.gui.hud.ClientBossBar;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.util.math.MatrixStack;
@@ -6,15 +6,15 @@ import me.retucio.sputnik.module.setting.Setting;
// se genera cada que se cambia el valor de un ajuste
public class UpdateSettingEvent extends Event {
private final Setting setting;
private final Setting<?> setting;
private boolean shouldSave;
public UpdateSettingEvent(Setting setting, boolean shouldSave) {
public UpdateSettingEvent(Setting<?> setting, boolean shouldSave) {
this.setting = setting;
this.shouldSave = shouldSave;
}
public Setting getSetting() {
public Setting<?> getSetting() {
return setting;
}
@@ -0,0 +1,31 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.interact.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.interact.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();
}
}
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.event.events.RenderBossbarEvent;
import me.retucio.sputnik.event.events.render.RenderBossbarEvent;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
@@ -59,7 +59,7 @@ public abstract class CameraMixin {
@Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true)
private void onClipToSpace(float distance, CallbackInfoReturnable<Float> cir) {
if (perspectivePlus.isEnabled() && perspectivePlus.clip.isEnabled())
if (perspectivePlus.isEnabled() && perspectivePlus.clip.getValue())
cir.setReturnValue(distance);
}
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.event.events.ReceiveMessageEvent;
import me.retucio.sputnik.event.events.network.ReceiveMessageEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import me.retucio.sputnik.util.interfaces.IChatHud;
@@ -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"))
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"))
private void onInit(CallbackInfo info) {
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);
}
}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.ChunkOcclusionEvent;
import me.retucio.sputnik.event.events.network.ChunkOcclusionEvent;
import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder;
import net.minecraft.util.math.BlockPos;
import org.spongepowered.asm.mixin.Mixin;
@@ -3,8 +3,8 @@ package me.retucio.sputnik.mixin;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import me.retucio.sputnik.event.Stage;
import me.retucio.sputnik.event.events.DisconnectEvent;
import me.retucio.sputnik.event.events.PacketEvent;
import me.retucio.sputnik.event.events.network.DisconnectEvent;
import me.retucio.sputnik.event.events.network.PacketEvent;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.network.packet.Packet;
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.event.events.SendMessageEvent;
import me.retucio.sputnik.event.events.network.SendMessageEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.render.NoRender;
import me.retucio.sputnik.util.ChatUtil;
@@ -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"))
private void noRenderTotemPop(GameRenderer instance, ItemStack floatingItem) {
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
if (!noRender.isEnabled() || noRender.totemPop.isEnabled())
if (!noRender.isEnabled() || noRender.totemPop.getValue())
mc.gameRenderer.showFloatingItem(floatingItem);
}
}
@@ -1,12 +1,10 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.AttackEntityEvent;
import me.retucio.sputnik.event.events.BreakBlockEvent;
import me.retucio.sputnik.event.events.InteractEntityEvent;
import me.retucio.sputnik.event.events.PlaceBlockEvent;
import me.retucio.sputnik.event.events.interact.*;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.player.FastUse;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
@@ -18,8 +16,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
@@ -31,6 +28,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
import static me.retucio.sputnik.Sputnik.mc;
@Mixin(ClientPlayerInteractionManager.class)
public abstract class ClientPlayerInteractionManagerMixin {
@@ -40,12 +38,15 @@ public abstract class ClientPlayerInteractionManagerMixin {
@Unique
Freecam freecam;
@Unique
FastUse fastUse;
@Inject(method = "<init>", at = @At("TAIL"))
private void getModules(MinecraftClient client, ClientPlayNetworkHandler networkHandler, CallbackInfo ci) {
freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
}
@Inject(method = "breakBlock", at = @At("HEAD"), cancellable = true)
private void onBlockBreak(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
BreakBlockEvent event = EVENT_BUS.post(new BreakBlockEvent(pos));
@@ -59,6 +60,12 @@ public abstract class ClientPlayerInteractionManagerMixin {
if (event.isCancelled()) cir.cancel();
}
@Inject(method = "attackBlock", at = @At("HEAD"), cancellable = true)
private void onAttackBlock(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
AttackBlockEvent event = EVENT_BUS.post(new AttackBlockEvent(pos, direction));
if (event.isCancelled()) cir.cancel();
}
@Inject(method = "interactEntity", at = @At("HEAD"), cancellable = true)
private void onEntityInteract(PlayerEntity player, Entity entity, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
if (mc.player != player) return;
@@ -74,11 +81,9 @@ public abstract class ClientPlayerInteractionManagerMixin {
}
@Inject(method = "updateBlockBreakingProgress", at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;blockBreakingCooldown:I"))
@Inject(method = "updateBlockBreakingProgress", at = @At("HEAD"))
private void modifyBlockBreakingCooldown(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
if (!fastUse.isEnabled() || !fastUse.mining.isEnabled()) return;
if (!fastUse.isEnabled() || !fastUse.mining.getValue()) return;
blockBreakingCooldown = fastUse.miningCooldown.getIntValue();
}
}
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.AddEntityEvent;
import me.retucio.sputnik.event.events.RemoveEntityEvent;
import me.retucio.sputnik.event.events.network.AddEntityEvent;
import me.retucio.sputnik.event.events.network.RemoveEntityEvent;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import org.jetbrains.annotations.Nullable;
@@ -0,0 +1,28 @@
package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.mixin.accessor.KeyBindingAccessor;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.CreativeInventoryHotbarKeybinds;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.client.input.KeyInput;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import java.util.Arrays;
import static me.retucio.sputnik.Sputnik.mc;
@Mixin(CreativeInventoryScreen.class)
public abstract class CreativeInventoryScreenMixin {
@ModifyExpressionValue(method = "keyPressed", at = @At(value = "INVOKE", target = "Ljava/util/OptionalInt;isPresent()Z"))
private boolean makeHotkeysWork(boolean original, @Local(argsOnly = true) KeyInput input) {
if (ModuleManager.INSTANCE.getModuleByClass(CreativeInventoryHotbarKeybinds.class).isEnabled())
return Arrays.stream(mc.options.hotbarKeys).anyMatch(
keyBinding -> ((KeyBindingAccessor) keyBinding).getBoundKey().getCode() == input.getKeycode()
);
return original;
}
}
@@ -41,7 +41,7 @@ abstract class DamageParticleFactoryMixin {
original.velocityMultiplier *= crits.velocityMultipler.getFloatValue();
original.gravityStrength *= crits.gravity.getFloatValue();
original.setMaxAge(crits.maxAge.getIntValue());
original.collidesWithWorld = crits.collide.isEnabled();
original.collidesWithWorld = crits.collide.getValue();
return original;
}
@@ -1,17 +1,19 @@
package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.retucio.sputnik.event.events.ChangeRotationEvent;
import me.retucio.sputnik.event.events.render.ChangeRotationEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.camera.Freelook;
import me.retucio.sputnik.module.modules.camera.Rotations;
import me.retucio.sputnik.module.modules.misc.AntiInvis;
import me.retucio.sputnik.module.modules.movement.BoatFly;
import me.retucio.sputnik.module.modules.render.Nametags;
import net.minecraft.entity.*;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.world.World;
@@ -88,7 +90,7 @@ public abstract class EntityMixin {
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
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
String damage = nametags.getArrowDamage(arrow);
@@ -98,10 +100,19 @@ public abstract class EntityMixin {
return original;
}
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
private Text showTntPrimeTime(Text original) {
if (!nametags.isEnabled() || !nametags.tntPrime.getValue()) return original;
if ((Object) this instanceof TntEntity tnt) {
return Text.of(nametags.getTntPrimeTime(tnt));
}
return original;
}
@SuppressWarnings("ConstantConditions")
@ModifyReturnValue(method = "getCustomName", at = @At("RETURN"))
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 (original != null) return original.copy().append(" (de " + nametags.getOwnerName(entity.getOwnerReference()) + ")");
else return Text.of(nametags.getOwnerName(entity.getOwnerReference()));
@@ -113,7 +124,7 @@ public abstract class EntityMixin {
@SuppressWarnings("ConstantConditions")
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
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)");
return original;
}
@@ -146,7 +157,16 @@ public abstract class EntityMixin {
// otros
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
public void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
private void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
if (ModuleManager.INSTANCE.getModuleByClass(AntiInvis.class).isEnabled()) cir.setReturnValue(false);
}
@SuppressWarnings("ConstantConditions")
@Inject(method = "getStepHeight", at = @At("RETURN"), cancellable = true)
private void modifyBoatStepHeight(CallbackInfoReturnable<Float> cir) {
BoatFly boatFly = ModuleManager.INSTANCE.getModuleByClass(BoatFly.class);
if (((Object) this) instanceof AbstractBoatEntity && boatFly.isEnabled()) {
cir.setReturnValue(boatFly.stepHeight.getFloatValue());
}
}
}
@@ -33,10 +33,10 @@ public abstract class FogRendererMixin {
if (!noRender.isEnabled()) return instance.shouldApply(cameraSubmersionType, entity);
String className = instance.getClass().getSimpleName();
if ((className.equals("BlindnessEffectFogModifier") && !noRender.blindnessEffect.isEnabled())
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.isEnabled())
if ((className.equals("BlindnessEffectFogModifier") && !noRender.blindnessEffect.getValue())
|| (className.equals("DarknessEffectFogModifier") && !noRender.darknessEffect.getValue())
|| ((className.equals("LavaFogModifier") || className.equals("WaterFogModifier")
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.isEnabled()))
|| className.equals("PowederSnowFogModifier")) && !noRender.fluidOverlay.getValue()))
return false;
return instance.shouldApply(cameraSubmersionType, entity);
@@ -44,7 +44,7 @@ public abstract class FogRendererMixin {
@ModifyReturnValue(method = "getFogColor", at = @At("RETURN"))
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.WATER))
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"))
private float noRenderUnderwaterFog(float original) {
return (noRender.isEnabled() && !noRender.fluidOverlay.isEnabled()) ? 0 : original;
return (noRender.isEnabled() && !noRender.fluidOverlay.getValue()) ? 0 : original;
}
}
@@ -30,8 +30,9 @@ public abstract class FontManagerMixin {
if (id.equals(StyleSpriteSource.Font.DEFAULT.id())) {
cir.setReturnValue(getStorageInternal(
Identifier.of(
Sputnik.MOD_ID,
fonts.font.getValue())
Sputnik.MOD_ID,
fonts.getFont()
)
));
}
}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.PerspectiveChangeEvent;
import me.retucio.sputnik.event.events.render.PerspectiveChangeEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import net.minecraft.client.option.GameOptions;
@@ -1,9 +1,10 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.GetFOVEvent;
import me.retucio.sputnik.event.events.render.GetFOVEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.misc.UnfocusedCpu;
import me.retucio.sputnik.module.modules.render.NoRender;
import me.retucio.sputnik.module.modules.camera.Zoom;
import me.retucio.sputnik.util.interfaces.IVec3d;
@@ -11,6 +12,7 @@ import me.retucio.sputnik.util.interfaces.IVec3d;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.BufferBuilderStorage;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.item.HeldItemRenderer;
import net.minecraft.entity.Entity;
@@ -29,6 +31,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
import static me.retucio.sputnik.Sputnik.mc;
@Mixin(GameRenderer.class)
@@ -64,6 +67,12 @@ public abstract class GameRendererMixin {
return EVENT_BUS.post(new GetFOVEvent(original)).getFov();
}
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
private void avoidRenderingUnfocusedCpu(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) {
if (ModuleManager.INSTANCE.getModuleByClass(UnfocusedCpu.class).isEnabled() && !mc.isWindowFocused())
ci.cancel();
}
@Inject(method = "updateCrosshairTarget", at = @At("HEAD"), cancellable = true)
private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo ci) {
if ((freecam.isEnabled()) && client.getCameraEntity() != null && !freecamDone) {
@@ -110,13 +119,13 @@ public abstract class GameRendererMixin {
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
private void renderHand(float tickProgress, boolean sleeping, Matrix4f positionMatrix, CallbackInfo ci) {
if ((zoom.isEnabled() && !zoom.showHands.isEnabled())
|| (freecam.isEnabled() && !freecam.renderHands.isEnabled()))
if ((zoom.isEnabled() && !zoom.showHands.getValue())
|| (freecam.isEnabled() && !freecam.renderHands.getValue()))
ci.cancel();
}
@ModifyVariable(method = "renderWorld", ordinal = 6, at = @At(value = "STORE"))
private float noRenderNauseaDistortion(float scaledNauseaEffectFactor) {
return (noRender.isEnabled() && !noRender.nauseaEffect.isEnabled()) ? 0 : scaledNauseaEffectFactor;
return (noRender.isEnabled() && !noRender.nauseaEffect.getValue()) ? 0 : scaledNauseaEffectFactor;
}
}
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.retucio.sputnik.event.events.RenderHeldItemEvent;
import me.retucio.sputnik.event.events.RenderArmEvent;
import me.retucio.sputnik.event.events.render.RenderHeldItemEvent;
import me.retucio.sputnik.event.events.render.RenderArmEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.player.HandView;
import net.minecraft.client.MinecraftClient;
@@ -65,19 +65,19 @@ public abstract class HeldItemRendererMixin {
@ModifyReturnValue(method = "shouldSkipHandAnimationOnSwap", at = @At("RETURN"))
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)
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)
private float modifyEquipProgressMainhand(float value) {
if (mc.player == null) return value;
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;
}
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.Render2DEvent;
import me.retucio.sputnik.event.events.render.Render2DEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import me.retucio.sputnik.module.modules.camera.Freecam;
@@ -40,32 +40,32 @@ public abstract class InGameHudMixin {
@Inject(method = "renderScoreboardSidebar*", at = @At("HEAD"), cancellable = true)
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)
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)
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)
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)
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)
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();
}
@@ -84,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)
private void onClear(CallbackInfo ci) {
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)
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)
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 (nametags.countItems.isEnabled()) {
if (nametags.countItems.getValue()) {
if (count > 1) return name.copy().append(" x" + count);
return name;
}
@@ -23,7 +23,7 @@ public abstract class ItemMixin {
@Inject(method = "appendTooltip", at = @At("HEAD"))
private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type, CallbackInfo ci) {
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 (ShulkerPeek.isShulkerEmpty(stack)) {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.DamageItemEvent;
import me.retucio.sputnik.event.events.interact.DamageItemEvent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
@@ -16,7 +16,7 @@ public abstract class KeyInputMixin extends Input {
@Inject(method = "tick", at = @At("TAIL"))
private void isPressed(CallbackInfo ci) {
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(
false, false,
false, false,
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.event.events.input.KeyEvent;
import net.minecraft.client.Keyboard;
import net.minecraft.client.input.KeyInput;
import org.spongepowered.asm.mixin.Mixin;
@@ -55,6 +55,6 @@ public abstract class LightmapTextureManagerMixin {
@Inject(method = "getDarkness", at = @At("HEAD"), cancellable = true)
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,8 +1,8 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.player.ElytraBounce;
import me.retucio.sputnik.module.modules.player.Step;
import me.retucio.sputnik.module.modules.movement.ElytraBounce;
import me.retucio.sputnik.module.modules.movement.Step;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.sound.SoundCategory;
@@ -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"))
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"))
private boolean renderInvisPlayerNametags(boolean original) {
if (nametags.isEnabled() && nametags.alwaysVisible.isEnabled()) return false;
if (nametags.isEnabled() && nametags.alwaysVisible.getValue()) return false;
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)
private void renderSelfNametag(T livingEntity, double d, CallbackInfoReturnable<Boolean> cir) {
if (livingEntity instanceof PlayerEntity player) {
if (player == mc.player && nametags.showSelf.isEnabled()) {
if (player == mc.player && nametags.showSelf.getValue()) {
cir.setReturnValue(true);
cir.cancel();
}
@@ -2,11 +2,11 @@ package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.JoinWorldEvent;
import me.retucio.sputnik.event.events.OpenScreenEvent;
import me.retucio.sputnik.event.events.network.JoinWorldEvent;
import me.retucio.sputnik.event.events.interact.OpenScreenEvent;
import me.retucio.sputnik.event.events.ShutdownEvent;
import me.retucio.sputnik.event.events.TickEvent;
import me.retucio.sputnik.event.events.UseItemEvent;
import me.retucio.sputnik.event.events.interact.UseItemEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.player.FastUse;
import net.minecraft.client.MinecraftClient;
@@ -14,7 +14,6 @@ import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.event.events.MouseClickEvent;
import me.retucio.sputnik.event.events.MouseScrollEvent;
import me.retucio.sputnik.event.events.input.MouseClickEvent;
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
import net.minecraft.client.Mouse;
import net.minecraft.client.input.MouseInput;
import org.spongepowered.asm.mixin.Mixin;
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.ClipAtLedgeEvent;
import me.retucio.sputnik.event.events.interact.ClipAtLedgeEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.render.Nametags;
import net.minecraft.entity.EntityType;
@@ -26,7 +26,7 @@ public abstract class PlayerEntityMixin extends LivingEntity {
@ModifyReturnValue(method = "getDisplayName", at = @At("RETURN"))
private Text addHealthIndicator(Text original) {
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 absorption = getAbsorptionAmount();
@@ -3,7 +3,7 @@ package me.retucio.sputnik.mixin;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.config.ConfigManager;
import me.retucio.sputnik.event.events.ClientClickEvent;
import me.retucio.sputnik.event.events.input.ClientClickEvent;
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
@@ -0,0 +1,17 @@
package me.retucio.sputnik.mixin;
import me.retucio.sputnik.util.render.Pipelines;
import net.minecraft.client.gl.ShaderLoader;
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.callback.CallbackInfo;
@Mixin(ShaderLoader.class)
public abstract class ShaderLoaderMixin {
@Inject(method = "apply(Lnet/minecraft/client/gl/ShaderLoader$Definitions;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V", at = @At("TAIL"))
private void onReload(CallbackInfo ci) {
Pipelines.init();
}
}
@@ -26,13 +26,13 @@ public abstract class SkyRendererMixin {
@Inject(method = "renderSun", at = @At("HEAD"), cancellable = true)
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)
private void onRenderMoon(MoonPhase moonPhase, float alpha, MatrixStack matrices, CallbackInfo ci) {
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"))
@@ -45,12 +45,12 @@ public abstract class SkyRendererMixin {
@Inject(method = "renderStars", at = @At("HEAD"), cancellable = true)
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)
private void onEndFlash(MatrixStack matrixStack, float f, float skyFactor, float pitch, CallbackInfo ci) {
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) {
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
if (!noRender.isEnabled()) return original;
if (getStatusEffect() == StatusEffects.BLINDNESS && !noRender.blindnessEffect.isEnabled()) return false;
if (getStatusEffect() == StatusEffects.DARKNESS && !noRender.darknessEffect.isEnabled()) return false;
if (getStatusEffect() == StatusEffects.BLINDNESS && !noRender.blindnessEffect.getValue()) return false;
if (getStatusEffect() == StatusEffects.DARKNESS && !noRender.darknessEffect.getValue()) return false;
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)
private static int onTruncate(int maxLength) {
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"))
private int noRenderStuckArrows(int original) {
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;
}
}
@@ -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"))
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"))
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"))
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"))
@@ -13,6 +13,6 @@ public abstract class TextRendererMixin {
@ModifyExpressionValue(method = "getGlyph", at = @At(value = "INVOKE", target = "Lnet/minecraft/text/Style;isObfuscated()Z"))
private boolean noRenderMTS(boolean original) {
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)
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"))
private void noRenderRainAndSnow(VertexConsumerProvider vertexConsumers, Vec3d pos, WeatherRenderState weatherRenderState, CallbackInfo ci) {
if (noRender.isEnabled()) {
if (!noRender.rain.isEnabled()) weatherRenderState.rainPieces.clear();
if (!noRender.snow.isEnabled()) weatherRenderState.snowPieces.clear();
if (!noRender.rain.getValue()) weatherRenderState.rainPieces.clear();
if (!noRender.snow.getValue()) weatherRenderState.snowPieces.clear();
}
}
}
@@ -1,19 +1,17 @@
package me.retucio.sputnik.mixin;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.Render3DEvent;
import me.retucio.sputnik.event.events.render.Render3DEvent;
import me.retucio.sputnik.event.events.render.RenderBlockOutlineEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.render.BlockOutline;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.render.NoRender;
import net.minecraft.client.render.*;
import net.minecraft.client.render.state.WorldRenderState;
import net.minecraft.client.util.ObjectAllocator;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.ColorHelper;
import net.minecraft.util.math.RotationAxis;
import net.minecraft.util.profiler.Profiler;
import org.joml.Matrix4f;
@@ -22,8 +20,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.lang.annotation.Target;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
import static me.retucio.sputnik.Sputnik.mc;
@@ -56,28 +53,39 @@ public abstract class WorldRendererMixin {
@Inject(method = "renderTargetBlockOutline", at = @At("HEAD"), cancellable = true)
private void noRenderBlockOutlinesFreecam(VertexConsumerProvider.Immediate immediate, MatrixStack matrices, boolean renderBlockOutline, WorldRenderState renderStates, CallbackInfo ci) {
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)
private void hasBlindnessOrDarkness(Camera camera, CallbackInfoReturnable<Boolean> cir) {
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
if (!noRender.isEnabled()) return;
if (!noRender.blindnessEffect.isEnabled() || !noRender.darknessEffect.isEnabled()) cir.setReturnValue(null);
if (!noRender.blindnessEffect.getValue() || !noRender.darknessEffect.getValue()) cir.setReturnValue(null);
}
@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();
@ModifyArgs(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 void modifyBlockOutline(Args args) {
// SIX SEVEN!!! (me pegan en casa)
RenderBlockOutlineEvent event = EVENT_BUS.post(new RenderBlockOutlineEvent(args.get(6), args.get(7)));
if (event.getColor() != (int) args.get(6))
args.set(6, event.getColor());
if (event.getLineWidth() != (float) args.get(7))
args.set(7, event.getLineWidth());
}
@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();
}
// @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) {
// RenderBlockOutlineEvent event = EVENT_BUS.post(new RenderBlockOutlineEvent(original, ))
//
// BlockOutline outline = ModuleManager.INSTANCE.getModuleByClass(BlockOutline.class);
// if (!outline.isEnabled()) return original;
// 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);
}
@@ -0,0 +1,15 @@
package me.retucio.sputnik.mixin.accessor;
import net.minecraft.entity.projectile.FishingBobberEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(FishingBobberEntity.class)
public interface FishingBobberEntityAccessor {
@Accessor("caughtFish")
boolean caughtFish();
@Accessor("state")
FishingBobberEntity.State getState();
}
@@ -2,7 +2,10 @@ package me.retucio.sputnik.module;
public enum Category {
COMBAT("combate"),
PLAYER("jugador"),
MOVEMENT("movimiento"),
WORLD("mundo"),
CAMERA("cámara"),
@@ -11,7 +14,9 @@ public enum Category {
NETWORK("red"),
CLIENT("cliente"),
MISC("misc.");
MISC("misc."),
ALL("todos");
private final String name;
Category(String name) { this.name = name; }
@@ -16,7 +16,6 @@ import org.lwjgl.glfw.GLFW;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
// clase base para los módulos
public class Module {
@@ -53,12 +52,12 @@ public class Module {
this.description = description;
this.category = category;
sgGeneral.addAll(bind, keyMode, notify);
this.bind.setDefaultKey(key);
this.bind.setDefaultValue(key);
// puto marcos
if (ConfigManager.getConfig().settings
.get(this.getName() + ":" + bind.getName()) == null)
this.bind.setKey(key);
this.bind.setValue(key);
}
@@ -83,8 +82,12 @@ public class Module {
return null;
}
public List<Setting> getSettings() {
List<Setting> settings = new ArrayList<>();
public SettingGroup getSgGeneral() {
return sgGeneral;
}
public List<Setting<?>> getSettings() {
List<Setting<?>> settings = new ArrayList<>();
sgs.forEach(sg -> sg.forEach(settings::add));
return settings;
}
@@ -99,7 +102,7 @@ public class Module {
}
public void onEnable() {
if (notify.isEnabled()) ChatUtil.info(getName() + " fue activado");
if (notify.getValue()) ChatUtil.info(getName() + " fue activado");
for (Method method : getClass().getDeclaredMethods())
if (method.isAnnotationPresent(SubscribeEvent.class)) {
Sputnik.EVENT_BUS.register(this);
@@ -109,7 +112,7 @@ public class Module {
}
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))
Sputnik.EVENT_BUS.unregister(this);
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
@@ -165,16 +168,16 @@ public class Module {
}
public int getKey() {
return bind.getKey();
return bind.getValue();
}
public void setKey(int key) {
bind.setKey(key);
bind.setValue(key);
}
public void assignKey(int key) {
bind.setDefaultKey(key);
bind.setKey(key);
bind.setDefaultValue(key);
bind.setValue(key);
}
public KeySetting getBind() {
@@ -2,9 +2,15 @@ package me.retucio.sputnik.module;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.module.modules.client.DiscordRPC;
import me.retucio.sputnik.module.modules.client.HUD;
import me.retucio.sputnik.module.modules.camera.*;
import me.retucio.sputnik.module.modules.combat.AttributeSwapper;
import me.retucio.sputnik.module.modules.combat.MaceKill;
import me.retucio.sputnik.module.modules.combat.ProjectileTrajectories;
import me.retucio.sputnik.module.modules.combat.SpearKill;
import me.retucio.sputnik.module.modules.misc.*;
import me.retucio.sputnik.module.modules.movement.*;
import me.retucio.sputnik.module.modules.network.*;
import me.retucio.sputnik.module.modules.player.*;
import me.retucio.sputnik.module.modules.render.*;
@@ -29,59 +35,18 @@ public class ModuleManager {
addModules();
}
// por orden alfabético y todo, flipas
private void addModules() {
modules.add(new AntiInvis());
modules.add(new AnvilFont());
modules.add(new AttributeSwapper());
modules.add(new AutoSign());
modules.add(new BlockESP());
modules.add(new BlockOutline());
modules.add(new BossbarStack());
modules.add(new BreakingProgress());
modules.add(new BungeecordSpoofer());
modules.add(new Capes());
modules.add(new ChatPlus());
modules.add(new ColoredSigns());
modules.add(new CritsPlus());
modules.add(new DamageOverlay());
modules.add(new ElytraBounce());
modules.add(new FakePlayer());
modules.add(new FastUse());
modules.add(new Fonts());
modules.add(new Freecam());
modules.add(new Freelook());
modules.add(new Fullbright());
modules.add(new GlintPlus());
modules.add(new HandView());
modules.add(new Headhitters());
modules.add(new HUD());
modules.add(new InventoryPlus());
modules.add(new LightOverlay());
modules.add(new LogoutSpots());
modules.add(new Nametags());
modules.add(new NoMiningInterruptions());
modules.add(new NoRender());
modules.add(new Offhand());
modules.add(new PacketDelay());
modules.add(new Particles());
modules.add(new PerspectivePlus());
modules.add(new PortalGUI());
modules.add(new Racist());
modules.add(new Reconnect());
modules.add(new ReverseStep());
modules.add(new Rotations());
modules.add(new RPackBypass());
modules.add(new SafeWalk());
modules.add(new ScreenshotPlus());
modules.add(new ShulkerPeek());
modules.add(new Step());
modules.add(new TimeChanger());
modules.add(new UIMove());
modules.add(new WarnLowDurability());
modules.add(new Zoom());
// añadir los módulos
addCamera();
addClient();
addMisc();
addMovement();
addNetwork();
addPlayer();
addRender();
addWorld();
modules.sort(Comparator.comparing(module -> module.getName().toLowerCase()));
modules.sort(Comparator.comparing(module -> MiscUtil.removeAccentMarks(module.getName().toLowerCase())));
// registrar los "listeners" necesarios
for (Module module : getEnabledModules()) {
@@ -94,6 +59,110 @@ public class ModuleManager {
}
}
private void add(Module module) {
modules.add(module);
}
private void addCamera() {
add(new Autism());
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 CreativeInventoryHotbarKeybinds());
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 AirPlace());
add(new AntiHunger());
add(new AttributeSwapper());
add(new AutoFish());
add(new Capes());
add(new FastUse());
add(new HandView());
add(new InventoryPlus());
add(new MaceKill());
add(new NoFall());
add(new Offhand());
add(new PortalGUI());
add(new UIMove());
add(new SpearKill());
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 AutoTool());
add(new BlockInfo());
add(new ColoredSigns());
add(new LightOverlay());
add(new NoMiningInterruptions());
add(new ProjectileTrajectories());
add(new Racist());
add(new StrongholdTriangulator());
add(new TimeChanger());
}
// para obtener módulos más fácilmente (por nombre, clase, o la lista completa)
public List<Module> getModules() {
@@ -0,0 +1,67 @@
package me.retucio.sputnik.module.modules.camera;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.network.PacketEvent;
import me.retucio.sputnik.module.Category;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.setting.settings.EnumSetting;
import me.retucio.sputnik.module.setting.settings.NumberSetting;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
public class Autism extends Module {
private final NumberSetting interval = sgGeneral.add(new NumberSetting(
"intervalo",
"intervalo de rotación",
18,
1,
90,
1
));
private final EnumSetting<RotationDirection> direction = sgGeneral.add(new EnumSetting<>(
"dirección",
"dirección de la rotación",
RotationDirection.class,
RotationDirection.CLOCKWISE
));
private float yaw;
public Autism() {
super("autismo", "jeje", Category.CAMERA);
}
@Override
public void onTick() {
if (mc.player == null || mc.getNetworkHandler() == null) return;
if (direction.is(RotationDirection.CLOCKWISE))
yaw += interval.getFloatValue();
if (direction.is(RotationDirection.COUNTERCLOCKWISE))
yaw -= interval.getFloatValue();
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(
yaw,
mc.player.getPitch(),
mc.player.isOnGround(),
mc.player.horizontalCollision
));
}
@SubscribeEvent
private void onPacketSend(PacketEvent.Send event) {
if (event.getPacket() instanceof PlayerMoveC2SPacket.LookAndOnGround packet
&& packet.getYaw(yaw) != yaw) event.cancel();
}
private enum RotationDirection {
CLOCKWISE("sentido horario"),
COUNTERCLOCKWISE("sentido antihorario");
private final String name;
RotationDirection(String name) { this.name = name; }
@Override public String toString() { return name; }
}
}
Loaded 100 of 216 files, more files were not shown because too many files have changed in this diff. Show more