Compare commits

..
8 Commits
Author SHA1 Message Date
retuci0 ad0349aa29 v3.4 2026-02-17 22:19:09 +01:00
retuci0 f1eed6f957 v3.3 2026-02-15 22:41:02 +01:00
retuci0 c993d4fdac v3.2 2026-02-10 16:06:38 +01:00
retuci0 a9fd8da7f5 v3.1 2026-02-09 17:52:39 +01:00
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
293 changed files with 7564 additions and 2056 deletions

No files matched your search

+1 -1
View File
@@ -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
+24 -24
View File
@@ -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,20 +11,30 @@ base {
} }
repositories { repositories {
// Add repositories to retrieve artifacts from in here. mavenCentral()
// You should only use this when depending on other mods because maven { url 'https://jitpack.io' }
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically. maven {
// See https://docs.gradle.org/current/userguide/declaring_repositories.html name = "FDD Maven"
// for more information about repositories. url = "https://maven.firstdark.dev/releases"
}
} }
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"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// mappings
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
// fabric & su api
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}"
// sistema de eventos
modImplementation "com.github.retuci0:neutrino:${project.neutrino_version}"
// rpc de discord
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
} }
loom { loom {
@@ -44,11 +54,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
} }
@@ -57,11 +62,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) {
@@ -70,11 +76,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.
}
} }
+5 -13
View File
@@ -1,27 +1,19 @@
# v2.6 # v3.3
## novedades ## novedades
### adiciones ### adiciones
- layouts de teclado (en_us y es_es) (fuck azerty) - ahora se puede asignar un botón del ratón a un módulo
- 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
#### módulos nuevos: #### módulos nuevos:
- fuentes: cambia la tipografía que usa todo el juego a una custom - mochila: te permite llevar items en los slots de crafteo del inventario
- escalones: actúa con la altura deseada como si se estuviesen subiendo escalones - tecla de perla: te permite lanzar una perla con tan solo un pulsamiento de tecla, siempre y cuando tengas en el inventario
- escalones inversos: escalones, pabajo
- partículas: genera particulas artificiales
### arreglos / mejoras ### arreglos / mejoras
- ahora puedes cambiar el grosor de las líneas del contorno de los bloques - arreglada la cagada de Mojang de las teclas debug
- 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
## problemas reconocidos ## 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/ No More Purple: https://github.com/Pepperoni-Jabroni/NoMorePurple/
bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack
elytra-recast: https://github.com/InLieuOfLuna/elytra-recast/ 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 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 :) si quieres que te acredite o quite tu código de mi mod, mándame un mensaje en discord (username: retucio) y sin problemas :)
+3 -1
View File
@@ -8,6 +8,8 @@ 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.6 neutrino_version=1.1.0
mod_version=3.3
maven_group=me.retucio maven_group=me.retucio
archives_base_name=sputnik archives_base_name=sputnik
Vendored Regular → Executable
View File
File mode changed.
+41 -24
View File
@@ -1,26 +1,27 @@
package me.retucio.sputnik; package me.retucio.sputnik;
import com.github.retucio.neutrino.EventBus;
import me.retucio.sputnik.cape.CapeManager; import me.retucio.sputnik.cape.CapeManager;
import me.retucio.sputnik.command.CommandManager; import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.command.commands.BindCommand; import me.retucio.sputnik.command.commands.BindCommand;
import me.retucio.sputnik.config.ConfigManager; import me.retucio.sputnik.config.ConfigManager;
import me.retucio.sputnik.event.EventBus; import me.retucio.sputnik.event.ShutdownEvent;
import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.interact.OpenScreenEvent;
import me.retucio.sputnik.event.events.ShutdownEvent; import me.retucio.sputnik.event.sputnik.LoadCapeManagerEvent;
import me.retucio.sputnik.event.events.sputnik.LoadCapeManagerEvent; import me.retucio.sputnik.event.sputnik.LoadClickGUIEvent;
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent; import me.retucio.sputnik.event.sputnik.LoadCommandManagerEvent;
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent; import me.retucio.sputnik.event.sputnik.LoadModuleManagerEvent;
import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent;
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.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.screen.UpdateScreen;
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton; import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
import me.retucio.sputnik.ui.widgets.buttons.SettingButton; import me.retucio.sputnik.ui.widgets.buttons.SettingButton;
import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton; import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton;
@@ -33,6 +34,7 @@ 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;
@@ -40,6 +42,7 @@ import net.minecraft.SharedConstants;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ChatScreen; import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.ingame.AbstractCommandBlockScreen; import net.minecraft.client.gui.screen.ingame.AbstractCommandBlockScreen;
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen; import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
import net.minecraft.client.gui.screen.ingame.AnvilScreen; import net.minecraft.client.gui.screen.ingame.AnvilScreen;
@@ -49,7 +52,6 @@ import org.apache.logging.log4j.Logger;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
public class Sputnik implements ClientModInitializer { public class Sputnik implements ClientModInitializer {
// cosas necesarias // cosas necesarias
@@ -80,17 +82,20 @@ public class Sputnik implements ClientModInitializer {
mc = MinecraftClient.getInstance(); mc = MinecraftClient.getInstance();
ConfigManager.load(); ConfigManager.load();
EVENT_BUS.register(this); VersionChecker.check();
EVENT_BUS.register(ChatUtil.class); EVENT_BUS.subscribe(this);
EVENT_BUS.register(DrawUtil.class);
EVENT_BUS.register(EntityUtil.class); EVENT_BUS.subscribe(ChatUtil.class);
EVENT_BUS.register(InventoryUtil.class); EVENT_BUS.subscribe(DrawUtil.class);
EVENT_BUS.register(MiscUtil.class); EVENT_BUS.subscribe(EntityUtil.class);
EVENT_BUS.register(NetworkUtil.class); EVENT_BUS.subscribe(InventoryUtil.class);
EVENT_BUS.register(RenderUtil.class); EVENT_BUS.subscribe(MiscUtil.class);
EVENT_BUS.subscribe(NetworkUtil.class);
EVENT_BUS.subscribe(RenderUtil.class);
Lists.init(); Lists.init();
Textures.init();
CapeManager.INSTANCE = new CapeManager(); CapeManager.INSTANCE = new CapeManager();
EVENT_BUS.post(new LoadCapeManagerEvent()); EVENT_BUS.post(new LoadCapeManagerEvent());
@@ -105,6 +110,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());
})); }));
@@ -120,12 +127,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 onInput(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 interrumpir combos de F3
boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused(); boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused();
ClickGUI.INSTANCE.setAnyFocused(anyFocused); ClickGUI.INSTANCE.setAnyFocused(anyFocused);
@@ -137,7 +145,10 @@ public class Sputnik implements ClientModInitializer {
handleClickGUIKey(key, anyFocused); handleClickGUIKey(key, anyFocused);
handleHudEditorKey(key, anyFocused); handleHudEditorKey(key, anyFocused);
} }
handleSettingButtonsKey(key, action); // solo reenviar teclas del teclado
if (key >= 32) {
handleSettingButtonsKey(key, action);
}
} else if (!anyFocused) { } else if (!anyFocused) {
handleModuleRelease(key); handleModuleRelease(key);
} }
@@ -181,8 +192,6 @@ public class Sputnik implements ClientModInitializer {
if (key != ClientSettingsFrame.guiSettings.getKey() || anyFocused || isOnTypingScreen()) if (key != ClientSettingsFrame.guiSettings.getKey() || anyFocused || isOnTypingScreen())
return; return;
// al parecer esto hace que con la tecla de la interfaz puedas ir cambiando de splash text en la pantalla del título
// pero me ha hecho gracia así que así se queda
if (mc.currentScreen != ClickGUI.INSTANCE) { if (mc.currentScreen != ClickGUI.INSTANCE) {
prevScreen = mc.currentScreen; prevScreen = mc.currentScreen;
mc.setScreen(ClickGUI.INSTANCE); mc.setScreen(ClickGUI.INSTANCE);
@@ -195,7 +204,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()) {
@@ -226,7 +235,15 @@ public class Sputnik implements ClientModInitializer {
|| mc.currentScreen instanceof AbstractCommandBlockScreen; || mc.currentScreen instanceof AbstractCommandBlockScreen;
} }
@SubscribeEvent // notificar al usuario de que hay una actualización disponible, si la hay
public void onSetScreen(OpenScreenEvent event) {
if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) {
event.cancel();
VersionChecker.shouldShowScreen = false;
mc.execute(() -> mc.currentScreen = new UpdateScreen());
}
}
public void onStop(ShutdownEvent event) { public void onStop(ShutdownEvent event) {
ConfigManager.save(); ConfigManager.save();
} }
@@ -1,10 +1,10 @@
package me.retucio.sputnik.command; package me.retucio.sputnik.command;
import com.github.retucio.neutrino.EventListener;
import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.command.commands.*; import me.retucio.sputnik.command.commands.*;
import me.retucio.sputnik.event.SubscribeEvent;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
@@ -32,24 +32,28 @@ public class CommandManager {
public static void registerCommands() { public static void registerCommands() {
addCommand(new BindCommand()); addCommand(new BindCommand());
addCommand(new ClickSlotCommand());
addCommand(new ConfigCommand()); addCommand(new ConfigCommand());
addCommand(new CopyScreenshotCommand()); addCommand(new CopyScreenshotCommand());
addCommand(new EnderChestCommand()); addCommand(new EnderChestCommand());
addCommand(new GarbageCleanerCommand()); addCommand(new GarbageCleanerCommand());
addCommand(new PeekCommand()); addCommand(new PeekCommand());
addCommand(new PluginsCommand());
addCommand(new PrefixCommand()); addCommand(new PrefixCommand());
addCommand(new PurgeCommand()); addCommand(new PurgeCommand());
addCommand(new RepeatCommand());
addCommand(new SaveScreenshotCommand()); addCommand(new SaveScreenshotCommand());
addCommand(new SendCommand()); addCommand(new SendCommand());
addCommand(new SpectateCommand()); addCommand(new SpectateCommand());
addCommand(new ToggleCommand()); addCommand(new ToggleCommand());
addCommand(new WaitCommand());
commands.sort(Comparator.comparing(Command::getName)); commands.sort(Comparator.comparing(Command::getName));
for (Command command : commands) { for (Command command : commands) {
for (Method method : command.getClass().getDeclaredMethods()) { for (Method method : command.getClass().getDeclaredMethods()) {
if (method.isAnnotationPresent(SubscribeEvent.class)) { if (method.isAnnotationPresent(EventListener.class)) {
Sputnik.EVENT_BUS.register(command); Sputnik.EVENT_BUS.subscribe(command);
break; break;
} }
} }
@@ -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);
}
}
@@ -5,12 +5,20 @@ 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.setting.settings.KeySetting; import me.retucio.sputnik.module.setting.settings.KeySetting;
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
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.client.input.KeyInput;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Formatting; import net.minecraft.util.Formatting;
import javax.swing.text.JTextComponent;
import java.util.ArrayList;
import java.util.List;
// asignar una tecla a un módulo, lógica similar a BindButton // asignar una tecla a un módulo, lógica similar a BindButton
public class BindCommand extends Command { public class BindCommand extends Command {
@@ -42,7 +50,25 @@ 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 (ClientSettingsFrame.guiSettings.multipleKeybinds.getValue()) {
List<KeyBinding> keys = new ArrayList<>(List.of(mc.options.allKeys));
keys.removeAll(List.of(mc.options.debugKeys));
for (KeyBinding kb : keys) {
boolean keyAlreadyBound = kb.matchesKey(new KeyInput(key, 0, 0));
boolean allowMultiple = ClientSettingsFrame.guiSettings.multipleKeybinds.getValue();
if (keyAlreadyBound && !allowMultiple) {
ChatUtil.warn("esa tecla ya está cogida por "
+ Formatting.GREEN + "\"" + I18n.translate(kb.getId()) + "\"");
listeningModule = null;
return true;
}
}
}
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,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 com.mojang.brigadier.context.CommandContext;
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.setting.Setting;
import me.retucio.sputnik.ui.screen.ClickGUI; import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame; import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
@@ -2,8 +2,7 @@ package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command; import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.TickEvent;
import me.retucio.sputnik.event.events.TickEvent;
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.InventoryUtil; import me.retucio.sputnik.util.InventoryUtil;
@@ -35,7 +34,6 @@ public class EnderChestCommand extends Command {
}); });
} }
@SubscribeEvent
public void onTick(TickEvent.Post event) { public void onTick(TickEvent.Post event) {
if (shouldOpenEchest) { if (shouldOpenEchest) {
shouldOpenEchest = false; shouldOpenEchest = false;
@@ -0,0 +1,111 @@
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.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);
}
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;
})
)
);
}
}
@@ -3,7 +3,7 @@ package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command; import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.mixin.accessor.ClientPlayNetworkHandlerAccessor; import me.retucio.sputnik.mixin.accessors.ClientPlayNetworkHandlerAccessor;
import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.network.encryption.NetworkEncryptionUtils; import net.minecraft.network.encryption.NetworkEncryptionUtils;
@@ -3,8 +3,7 @@ package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command; import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.EntityArgumentType; import me.retucio.sputnik.command.args.EntityArgumentType;
import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.input.KeyEvent;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.util.EntityUtil; import me.retucio.sputnik.util.EntityUtil;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -38,7 +37,6 @@ public class SpectateCommand extends Command {
); );
} }
@SubscribeEvent
public void onKey(KeyEvent event) { public void onKey(KeyEvent event) {
if (mc.getCameraEntity() != mc.player && mc.currentScreen == null if (mc.getCameraEntity() != mc.player && mc.currentScreen == null
&& event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) { && event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) {
@@ -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;
})
)
);
}
}
@@ -1,7 +1,6 @@
package me.retucio.sputnik.config; package me.retucio.sputnik.config;
import me.retucio.sputnik.event.SubscribeEvent; import me.retucio.sputnik.event.sputnik.*;
import me.retucio.sputnik.event.events.sputnik.*;
import me.retucio.sputnik.module.setting.settings.*; import me.retucio.sputnik.module.setting.settings.*;
import me.retucio.sputnik.ui.screen.ClickGUI; import me.retucio.sputnik.ui.screen.ClickGUI;
@@ -38,28 +37,26 @@ public class ClientConfig {
public Map<String, String> hudImagePaths = new HashMap<>(); public Map<String, String> hudImagePaths = new HashMap<>();
// posición de la barra de búsqueda (x, y) // posición de la barra de búsqueda (x, y)
public int[] searchBarPosition = new int[]{340, 16}; public int[] searchBarPosition = new int[] { 340, 16 };
public ClientConfig() { public ClientConfig() {
EVENT_BUS.register(this); EVENT_BUS.subscribe(this);
} }
@SubscribeEvent
public void onToggleModule(ToggleModuleEvent event) { public void onToggleModule(ToggleModuleEvent event) {
ConfigManager.setModuleState(event.getModule()); ConfigManager.setModuleState(event.getModule());
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@SubscribeEvent
public void onUpdateSetting(UpdateSettingEvent event) { public void onUpdateSetting(UpdateSettingEvent event) {
if (mc == null || !event.shouldSave()) return; if (mc == null || !event.shouldSave()) return;
// 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;
@@ -71,24 +68,20 @@ public class ClientConfig {
ConfigManager.setSetting(event.getSetting(), value); ConfigManager.setSetting(event.getSetting(), value);
} }
@SubscribeEvent
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) { public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
ConfigManager.setFramePosition(event.getFrame()); ConfigManager.setFramePosition(event.getFrame());
} }
@SubscribeEvent
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) { public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
settingsFrames.remove(event.getFrame().getModule().getName()); settingsFrames.remove(event.getFrame().getModule().getName());
ConfigManager.save(); ConfigManager.save();
} }
@SubscribeEvent
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) { public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()}); settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()});
ConfigManager.save(); ConfigManager.save();
} }
@SubscribeEvent
public void onExtendModuleFrame(ModuleFrameEvent.Extend event) { public void onExtendModuleFrame(ModuleFrameEvent.Extend event) {
extendableFrames.put("M", new FrameData( extendableFrames.put("M", new FrameData(
ClickGUI.INSTANCE.getModulesFrame().getX(), ClickGUI.INSTANCE.getModulesFrame().getX(),
@@ -96,7 +89,6 @@ public class ClientConfig {
ClickGUI.INSTANCE.getModulesFrame().extended)); ClickGUI.INSTANCE.getModulesFrame().extended));
} }
@SubscribeEvent
public void onMoveModuleFrame(ModuleFrameEvent.Move event) { public void onMoveModuleFrame(ModuleFrameEvent.Move event) {
extendableFrames.replace("M", new FrameData( extendableFrames.replace("M", new FrameData(
ClickGUI.INSTANCE.getModulesFrame().getX(), ClickGUI.INSTANCE.getModulesFrame().getX(),
@@ -104,7 +96,6 @@ public class ClientConfig {
ClickGUI.INSTANCE.getModulesFrame().extended)); ClickGUI.INSTANCE.getModulesFrame().extended));
} }
@SubscribeEvent
public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) { public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) {
extendableFrames.put("S", new FrameData( extendableFrames.put("S", new FrameData(
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(), ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
@@ -112,7 +103,6 @@ public class ClientConfig {
ClickGUI.INSTANCE.getGuiSettingsFrame().extended)); ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
} }
@SubscribeEvent
public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) { public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) {
extendableFrames.replace("S", new FrameData( extendableFrames.replace("S", new FrameData(
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(), ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
@@ -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();
@@ -150,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;
@@ -249,7 +249,7 @@ public class ConfigManager {
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);
} }
} }
@@ -275,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);
} }
} }
@@ -291,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);
} }
} }
@@ -342,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.getSg().getModule().getName() + ":" + setting.getName(); return setting.getSg().getModule().getName() + ":" + setting.getTrueName();
} }
public static boolean hasLoaded() { public static boolean hasLoaded() {
@@ -1,15 +0,0 @@
package me.retucio.sputnik.event;
// evento base, cancelable (usado en mixins)
public class Event {
private boolean cancelled;
public boolean isCancelled() {
return cancelled;
}
public void cancel() {
cancelled = true;
}
}
@@ -1,72 +0,0 @@
package me.retucio.sputnik.event;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
// al llamar un evento, se guarda en el bus de eventos, de donde luego se puede detectar si ese evento ha sucedido
public class EventBus {
private final Map<Class<?>, List<ListenerMethod>> listeners = new HashMap<>();
private record ListenerMethod(Object instance, Method method) {}
public void register(Object listener) {
Class<?> targetClass;
if (listener instanceof Class<?> clazz) {
targetClass = clazz; // "listeners" estáticos
listener = null;
} else {
targetClass = listener.getClass();
}
for (Method method : targetClass.getDeclaredMethods()) {
if (!method.isAnnotationPresent(SubscribeEvent.class)) continue;
if (method.getParameterCount() != 1) continue;
Class<?> eventType = method.getParameterTypes()[0];
method.setAccessible(true);
if (listener == null && !Modifier.isStatic(method.getModifiers())) continue;
listeners.computeIfAbsent(eventType, k -> new ArrayList<>())
.add(new ListenerMethod(listener, method));
}
}
public void subscribe(Object listener) { register(listener); }
public void unregister(Object listener) {
for (List<ListenerMethod> list : listeners.values()) {
list.removeIf(lm -> lm.instance == listener);
}
}
public void unsubscribe(Object listener) { unregister(listener); }
public <T extends Event> T post(T event) {
List<ListenerMethod> list = listeners.get(event.getClass());
if (list != null) {
for (ListenerMethod lm : new ArrayList<>(list)) { // copiar para evitar CME
try {
lm.method.invoke(lm.instance, event);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return event;
}
public boolean isRegistered(Object listener) {
for (List<ListenerMethod> list : listeners.values()) {
for (ListenerMethod lm : list) {
if (lm.instance == listener) {
return true;
}
}
}
return false;
}
}
@@ -0,0 +1,13 @@
package me.retucio.sputnik.event;
import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
/**
* @see MinecraftClientMixin#onStop
*/
public class ShutdownEvent extends Event {
public ShutdownEvent() {}
}
@@ -1,6 +0,0 @@
package me.retucio.sputnik.event;
public enum Stage {
PRE, // antes de que haya sucedido
POST; // después de que haya sucedido
}
@@ -1,8 +0,0 @@
package me.retucio.sputnik.event;
import java.lang.annotation.*;
// anotación para registar un "listener", que escucha cuando se llama un evento
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface SubscribeEvent {}
@@ -0,0 +1,15 @@
package me.retucio.sputnik.event;
import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
/**
* @see MinecraftClientMixin#onTickPre
* @see MinecraftClientMixin#onTickPost
*/
public class TickEvent {
public static class Pre extends Event {}
public static class Post extends Event {}
}
@@ -1,9 +0,0 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
/**
* @see me.retucio.sputnik.mixin.ChunkOcclusionDataBuilderMixin#onChunkOcclusion
*/
public class ChunkOcclusionEvent extends Event {}
@@ -1,12 +0,0 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onStop
*/
public class ShutdownEvent extends Event {
public ShutdownEvent() {}
}
@@ -1,14 +0,0 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPre
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPost
*/
public class TickEvent {
public static class Pre extends Event {}
public static class Post extends Event {}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.input;
import me.retucio.sputnik.module.modules.misc.ChatPlus; import me.retucio.sputnik.module.modules.misc.ChatPlus;
import net.minecraft.text.ClickEvent; import net.minecraft.text.ClickEvent;
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.input;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.io.KeyboardMixin;
/** /**
* @see me.retucio.sputnik.mixin.KeyboardMixin#onKeyPress * @see KeyboardMixin#onKeyPress
*/ */
public class KeyEvent extends Event { public class KeyEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.input;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
/** /**
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseButton * @see MouseMixin#onMouseButton
*/ */
public class MouseClickEvent extends Event { public class MouseClickEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.input;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
/** /**
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseScroll * @see MouseMixin#onMouseScroll
*/ */
public class MouseScrollEvent extends Event { public class MouseScrollEvent extends Event {
@@ -0,0 +1,24 @@
package me.retucio.sputnik.event.interact;
import com.github.retucio.neutrino.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,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
/** /**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onAttackEntity * @see ClientPlayerInteractionManagerMixin#onAttackEntity
*/ */
public class AttackEntityEvent extends Event { public class AttackEntityEvent extends Event {
@@ -0,0 +1,43 @@
package me.retucio.sputnik.event.interact;
import com.github.retucio.neutrino.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.interact;
import com.github.retucio.neutrino.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,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
/** /**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockBreak * @see ClientPlayerInteractionManagerMixin#onBlockBreak
*/ */
public class BreakBlockEvent extends Event { public class BreakBlockEvent extends Event {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
public class ClipAtLedgeEvent extends Event { public class ClipAtLedgeEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.item.ItemStackMixin;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
/** /**
* @see me.retucio.sputnik.mixin.ItemStackMixin#onDamage * @see ItemStackMixin#onDamage
*/ */
public class DamageItemEvent extends Event { public class DamageItemEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
/** /**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onEntityInteract * @see ClientPlayerInteractionManagerMixin#onEntityInteract
*/ */
public class InteractEntityEvent extends Event { public class InteractEntityEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
/** /**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onOpenScreen * @see MinecraftClientMixin#onOpenScreen
*/ */
public class OpenScreenEvent extends Event { public class OpenScreenEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.BlockHitResult;
/** /**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockPlace * @see ClientPlayerInteractionManagerMixin#onBlockPlace
*/ */
public class PlaceBlockEvent extends Event { public class PlaceBlockEvent extends Event {
@@ -0,0 +1,26 @@
package me.retucio.sputnik.event.interact;
import com.github.retucio.neutrino.Event;
public class SwitchSlotEvent extends Event {
private final int prevSlot;
private int slot;
public SwitchSlotEvent(int prevSlot, int slot) {
this.prevSlot = prevSlot;
this.slot = slot;
}
public int getPrevSlot() {
return prevSlot;
}
public int getSlot() {
return slot;
}
public void setSlot(int slot) {
this.slot = slot;
}
}
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.interact;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
/** /**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onUseItem * @see MinecraftClientMixin#onUseItem
*/ */
public class UseItemEvent extends Event { public class UseItemEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
/** /**
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onAddEntity * @see ClientWorldMixin#onAddEntity
*/ */
public class AddEntityEvent extends Event { public class AddEntityEvent extends Event {
@@ -0,0 +1,10 @@
package me.retucio.sputnik.event.network;
import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.world.ChunkOcclusionDataBuilderMixin;
/**
* @see ChunkOcclusionDataBuilderMixin#onChunkOcclusion
*/
public class ChunkOcclusionEvent extends Event {}
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
import net.minecraft.client.network.ServerInfo; import net.minecraft.client.network.ServerInfo;
import net.minecraft.network.DisconnectionInfo; import net.minecraft.network.DisconnectionInfo;
/** /**
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onDisconnect * @see ClientConnectionMixin#onDisconnect
*/ */
public class DisconnectEvent extends Event { public class DisconnectEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
import net.minecraft.client.world.ClientWorld; import net.minecraft.client.world.ClientWorld;
/** /**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onJoinWorld * @see MinecraftClientMixin#onJoinWorld
*/ */
public class JoinWorldEvent extends Event { public class JoinWorldEvent extends Event {
@@ -1,34 +1,29 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.event.Stage; import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet;
/** /**
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPre * @see ClientConnectionMixin#onSendPacketPre
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPost * @see ClientConnectionMixin#onSendPacketPost
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onReceivePacket * @see ClientConnectionMixin#onReceivePacket
*/ */
public class PacketEvent { public class PacketEvent {
public static class Send extends Event { public static class Send extends Event {
private final Packet<?> packet; private final Packet<?> packet;
private final Stage stage;
public Send(Packet<?> packet, Stage stage) { public Send(Packet<?> packet, Stage stage) {
this.packet = packet; this.packet = packet;
this.stage = stage; this.setStage(stage);
} }
public Packet<?> getPacket() { public Packet<?> getPacket() {
return packet; return packet;
} }
public Stage getStage() {
return stage;
}
} }
public static class Receive extends Event { public static class Receive extends Event {
@@ -1,17 +1,18 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.hud.ChatHudMixin;
import net.minecraft.client.gui.hud.MessageIndicator; import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.text.Text; import net.minecraft.text.Text;
/** /**
* @see me.retucio.sputnik.mixin.ChatHudMixin#onAddMessage * @see ChatHudMixin#onAddMessage
*/ */
public class ReceiveMessageEvent extends Event { public class ReceiveMessageEvent extends Event {
private Text text; private Text text;
private MessageIndicator indicator; private MessageIndicator indicator;
private int id; private final int id;
private boolean modified = false; private boolean modified = false;
public ReceiveMessageEvent(Text text, MessageIndicator indicator, int id) { public ReceiveMessageEvent(Text text, MessageIndicator indicator, int id) {
@@ -42,5 +43,7 @@ public class ReceiveMessageEvent extends Event {
return modified; return modified;
} }
public int getId() {
return id;
}
} }
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
/** /**
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onRemoveEntity * @see ClientWorldMixin#onRemoveEntity
*/ */
public class RemoveEntityEvent extends Event { public class RemoveEntityEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.network;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.network.ClientPlayNetworkHandlerMixin;
/** /**
* @see me.retucio.sputnik.mixin.ClientPlayNetworkHandlerMixin#onSendMessage * @see ClientPlayNetworkHandlerMixin#onSendMessage
*/ */
public class SendMessageEvent extends Event { public class SendMessageEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
/** /**
* @see me.retucio.sputnik.mixin.EntityMixin#onRotation * @see EntityMixin#onRotation
* @see me.retucio.sputnik.mixin.EntityMixin#onChangeYaw * @see EntityMixin#onChangeYaw
* @see me.retucio.sputnik.mixin.EntityMixin#onChangePitch * @see EntityMixin#onChangePitch
*/ */
public class ChangeRotationEvent extends Event { public class ChangeRotationEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.render.GameRendererMixin;
/** /**
* @see me.retucio.sputnik.mixin.GameRendererMixin#modifyFov * @see GameRendererMixin#modifyFov
*/ */
public class GetFOVEvent extends Event { public class GetFOVEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.misc.GameOptionsMixin;
import net.minecraft.client.option.Perspective; import net.minecraft.client.option.Perspective;
/** /**
* @see me.retucio.sputnik.mixin.GameOptionsMixin#changePerspective * @see GameOptionsMixin#changePerspective
*/ */
public class PerspectiveChangeEvent extends Event { public class PerspectiveChangeEvent extends Event {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.RenderTickCounter; import net.minecraft.client.render.RenderTickCounter;
@@ -1,13 +1,14 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.render.WorldRendererMixin;
import net.minecraft.client.render.Camera; import net.minecraft.client.render.Camera;
import net.minecraft.client.render.RenderTickCounter; import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
/** /**
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render * @see WorldRendererMixin#render
*/ */
public class Render3DEvent extends Event { public class Render3DEvent extends Event {
@@ -32,4 +33,8 @@ public class Render3DEvent extends Event {
public Camera getCamera() { public Camera getCamera() {
return camera; return camera;
} }
public float getTickDelta() {
return tc.getDynamicDeltaTicks();
}
} }
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
/** /**
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderArm * @see HeldItemRendererMixin#onRenderArm
*/ */
public class RenderArmEvent extends Event { public class RenderArmEvent extends Event {
@@ -0,0 +1,30 @@
package me.retucio.sputnik.event.render;
import com.github.retucio.neutrino.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,6 +1,7 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.hud.BossBarHudMixin;
import net.minecraft.client.gui.hud.ClientBossBar; import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text; import net.minecraft.text.Text;
@@ -8,9 +9,9 @@ import java.util.Iterator;
/** /**
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarIterator * @see BossBarHudMixin#modifyBossBarIterator
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarName * @see BossBarHudMixin#modifyBossBarName
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifySpacingConstant * @see BossBarHudMixin#modifySpacingConstant
*/ */
public class RenderBossbarEvent { public class RenderBossbarEvent {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events; package me.retucio.sputnik.event.render;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
/** /**
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderItem * @see HeldItemRendererMixin#onRenderItem
*/ */
public class RenderHeldItemEvent extends Event { public class RenderHeldItemEvent extends Event {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
// se genera cada que se interactúa con el marco de ajustes de la interfaz // se genera cada que se interactúa con el marco de ajustes de la interfaz
public class GUISettingsFrameEvent { public class GUISettingsFrameEvent {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
// se genera cuando carga el gestor de capas // se genera cuando carga el gestor de capas
public class LoadCapeManagerEvent extends Event {} public class LoadCapeManagerEvent extends Event {}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
// se genera cuando carga la interfaz del mod // se genera cuando carga la interfaz del mod
public class LoadClickGUIEvent extends Event {} public class LoadClickGUIEvent extends Event {}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
// se genera cuando carga el gestor de comandos // se genera cuando carga el gestor de comandos
public class LoadCommandManagerEvent extends Event {} public class LoadCommandManagerEvent extends Event {}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
public class LoadConfigEvent extends Event { public class LoadConfigEvent extends Event {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
// se genera cuando carga el gestor de módulos // se genera cuando carga el gestor de módulos
public class LoadModuleManagerEvent extends Event {} public class LoadModuleManagerEvent extends Event {}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
// se genera cada que se interactúa con el marco de módulos // se genera cada que se interactúa con el marco de módulos
public class ModuleFrameEvent { public class ModuleFrameEvent {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame; import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
// se genera cada que se interactúa con un marco de ajustes de un módulo // se genera cada que se interactúa con un marco de ajustes de un módulo
@@ -1,6 +1,6 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.module.Module; import me.retucio.sputnik.module.Module;
// se genera cada que se enciende o apaga un módulo // se genera cada que se enciende o apaga un módulo
@@ -1,20 +1,20 @@
package me.retucio.sputnik.event.events.sputnik; package me.retucio.sputnik.event.sputnik;
import me.retucio.sputnik.event.Event; import com.github.retucio.neutrino.Event;
import me.retucio.sputnik.module.setting.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,13 @@
package me.retucio.sputnik.mixin.accessors;
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);
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.block.entity.SignBlockEntity; import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen; import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
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;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.message.LastSeenMessagesCollector; import net.minecraft.network.message.LastSeenMessagesCollector;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.network.ClientCommonNetworkHandler; import net.minecraft.client.network.ClientCommonNetworkHandler;
@@ -0,0 +1,15 @@
package me.retucio.sputnik.mixin.accessors;
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();
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.screen.slot.Slot; import net.minecraft.screen.slot.Slot;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.client.option.KeyBinding; import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil; import net.minecraft.client.util.InputUtil;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.texture.NativeImageBackedTexture; import net.minecraft.client.texture.NativeImageBackedTexture;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.client.network.ClientCommonNetworkHandler; import net.minecraft.client.network.ClientCommonNetworkHandler;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin.accessor; package me.retucio.sputnik.mixin.accessors;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -0,0 +1,31 @@
package me.retucio.sputnik.mixin.mixins.entity;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.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();
}
}
}
@@ -1,17 +1,19 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.entity;
import com.llamalad7.mixinextras.injector.ModifyReturnValue; import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.retucio.sputnik.event.events.ChangeRotationEvent; import me.retucio.sputnik.event.render.ChangeRotationEvent;
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.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;
@@ -88,7 +90,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);
@@ -98,10 +100,19 @@ public abstract class EntityMixin {
return original; 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") @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 +124,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 +157,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());
}
}
} }
@@ -0,0 +1,37 @@
package me.retucio.sputnik.mixin.mixins.entity;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.render.EntityESP;
import net.minecraft.client.render.entity.EntityRenderer;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.entity.Entity;
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.callback.CallbackInfo;
@Mixin(EntityRenderer.class)
public abstract class EntityRendererMixin {
@Unique
private EntityESP esp;
@Inject(method = "<init>", at = @At("TAIL"))
private void getModules(EntityRendererFactory.Context context, CallbackInfo ci) {
esp = ModuleManager.INSTANCE.getModuleByClass(EntityESP.class);
}
@ModifyExpressionValue(method = "updateRenderState", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;hasOutline(Lnet/minecraft/entity/Entity;)Z"))
private boolean renderGlowESP(boolean original, @Local(argsOnly = true) Entity entity) {
return (esp.isEnabled() && esp.mode.is(EntityESP.ESPMode.GLOW) && esp.entities.isEnabled(entity.getType())) || original;
}
@ModifyExpressionValue(method = "updateRenderState", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getTeamColorValue()I"))
private int setGlowESPColor(int original, @Local(argsOnly = true) Entity entity) {
if (esp.isEnabled() && esp.mode.is(EntityESP.ESPMode.GLOW) && esp.entities.isEnabled(entity.getType())) return esp.glowColor.getRGB();
return original;
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.entity;
import com.llamalad7.mixinextras.injector.ModifyReturnValue; import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.ModuleManager;
@@ -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;
} }
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.entity;
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.player.Step; 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;
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.hud;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local; import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.event.events.RenderBossbarEvent; import me.retucio.sputnik.event.render.RenderBossbarEvent;
import net.minecraft.client.gui.hud.BossBarHud; import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar; import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text; import net.minecraft.text.Text;
@@ -0,0 +1,52 @@
package me.retucio.sputnik.mixin.mixins.hud;
import com.llamalad7.mixinextras.injector.ModifyReceiver;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import net.minecraft.client.font.Alignment;
import net.minecraft.client.font.DrawnTextConsumer;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.text.OrderedText;
import net.minecraft.util.math.ColorHelper;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ChatHud.Interactable.class)
public abstract class ChatHudInteractableMixin {
@Unique
private static ChatPlus chatPlus;
@Shadow @Final
private DrawContext context;
@Inject(method = "<init>", at = @At("TAIL"))
private void getModules(DrawContext context, TextRenderer textRenderer, int mouseX, int mouseY, boolean bl, CallbackInfo ci) {
chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
}
@ModifyReceiver(method = "text", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/DrawnTextConsumer;text(Lnet/minecraft/client/font/Alignment;IILnet/minecraft/client/font/DrawnTextConsumer$Transformation;Lnet/minecraft/text/OrderedText;)V"))
private DrawnTextConsumer onRender_beforeDrawTextWithShadow(DrawnTextConsumer instance, Alignment alignment, int x, int y, DrawnTextConsumer.Transformation transformation, OrderedText orderedText) {
chatPlus.beforeDrawMessage(context, y, ColorHelper.getWhite(transformation.opacity()));
return instance;
}
@ModifyArg(method = "text", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/DrawnTextConsumer;text(Lnet/minecraft/client/font/Alignment;IILnet/minecraft/client/font/DrawnTextConsumer$Transformation;Lnet/minecraft/text/OrderedText;)V"), index = 1)
private int modifyX(int x) {
return (chatPlus.isEnabled() && chatPlus.showHeads.getValue()) ? x + 10 : x;
}
@Inject(method = "text", at = @At("TAIL"))
private void onRender_afterDrawTextWithShadow(int y, float f, OrderedText text, CallbackInfoReturnable<Boolean> cir) {
chatPlus.afterDrawMessage();
}
}
@@ -0,0 +1,18 @@
package me.retucio.sputnik.mixin.mixins.hud;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import net.minecraft.client.gui.hud.ChatHudLine;
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(targets = "net.minecraft.client.gui.hud.ChatHud$1", remap = false)
public abstract class ChatHudLineConsumerMixin {
@Inject(method = "accept", at = @At("HEAD"))
private void setLine(ChatHudLine.Visible line, int y, float opacity, CallbackInfo ci) {
ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class).line = line;
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.hud;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import me.retucio.sputnik.util.interfaces.IChatHudLine; import me.retucio.sputnik.util.interfaces.IChatHudLine;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.hud;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import me.retucio.sputnik.util.interfaces.IChatHudLineVisible; import me.retucio.sputnik.util.interfaces.IChatHudLineVisible;
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.hud;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local; import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.event.events.ReceiveMessageEvent; import me.retucio.sputnik.event.network.ReceiveMessageEvent;
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.util.interfaces.IChatHud; 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")) @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;
} }
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.hud;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.Render2DEvent; import me.retucio.sputnik.event.render.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;
@@ -40,32 +40,32 @@ public abstract class InGameHudMixin {
@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();
} }
@@ -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) @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();
} }
} }
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.io;
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;
@@ -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,
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.io;
import me.retucio.sputnik.Sputnik; import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.KeyEvent; import me.retucio.sputnik.event.input.KeyEvent;
import net.minecraft.client.Keyboard; import net.minecraft.client.Keyboard;
import net.minecraft.client.input.KeyInput; import net.minecraft.client.input.KeyInput;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -17,7 +17,7 @@ public abstract class KeyboardMixin {
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true) @Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
private void onKeyPress(long window, int action, KeyInput input, CallbackInfo ci) { private void onKeyPress(long window, int action, KeyInput input, CallbackInfo ci) {
if (input.key() == -1) return; if (input.key() == -1) return;
Sputnik.INSTANCE.onKey(input.key(), action); Sputnik.INSTANCE.onInput(input.key(), action);
KeyEvent event = EVENT_BUS.post(new KeyEvent(input.key(), input.scancode(), action)); KeyEvent event = EVENT_BUS.post(new KeyEvent(input.key(), input.scancode(), action));
if (event.isCancelled()) ci.cancel(); if (event.isCancelled()) ci.cancel();
} }
@@ -1,7 +1,8 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.io;
import me.retucio.sputnik.event.events.MouseClickEvent; import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.MouseScrollEvent; import me.retucio.sputnik.event.input.MouseClickEvent;
import me.retucio.sputnik.event.input.MouseScrollEvent;
import net.minecraft.client.Mouse; import net.minecraft.client.Mouse;
import net.minecraft.client.input.MouseInput; import net.minecraft.client.input.MouseInput;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -16,6 +17,7 @@ public abstract class MouseMixin {
@Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true) @Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true)
private void onMouseButton(long window, MouseInput input, int action, CallbackInfo ci) { private void onMouseButton(long window, MouseInput input, int action, CallbackInfo ci) {
Sputnik.INSTANCE.onInput(input.button(), action);
MouseClickEvent event = EVENT_BUS.post(new MouseClickEvent(action, input.button())); MouseClickEvent event = EVENT_BUS.post(new MouseClickEvent(action, input.button()));
if (event.isCancelled()) ci.cancel(); if (event.isCancelled()) ci.cancel();
} }
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.io;
import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ScreenshotPlus; import me.retucio.sputnik.module.modules.misc.ScreenshotPlus;
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin; package me.retucio.sputnik.mixin.mixins.item;
import me.retucio.sputnik.module.ModuleManager; import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ShulkerPeek; import me.retucio.sputnik.module.modules.inventory.ShulkerPeek;
import net.minecraft.block.ShulkerBoxBlock; import net.minecraft.block.ShulkerBoxBlock;
import net.minecraft.component.type.TooltipDisplayComponent; import net.minecraft.component.type.TooltipDisplayComponent;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
@@ -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)) {
Loaded 100 of 293 files, more files were not shown because too many files have changed in this diff. Show more