Compare commits

...
7 Commits
Author SHA1 Message Date
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
retuci0 9afaa4e0c8 v2.6 2026-01-11 11:12:44 +01:00
291 changed files with 8131 additions and 1611 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# jenny's mod 2 100% real
mod para Minecraft Fabric 1.21.10 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
mod para Minecraft Fabric 1.21.11 que añade algunas cosas QOL, mayormente relacionadas a la cámara.
## instalación
+13 -23
View File
@@ -1,6 +1,6 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
}
version = project.mod_version
@@ -11,21 +11,21 @@ base {
}
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {
name = "FDD Maven"
url = "https://maven.firstdark.dev/releases"
}
}
dependencies {
// To change the versions see the gradle.properties file
// mc
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
// otros
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
}
loom {
@@ -45,11 +45,6 @@ tasks.withType(JavaCompile).configureEach {
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
@@ -58,11 +53,12 @@ jar {
inputs.property "archivesName", project.base.archivesName
from("LICENSE") {
rename { "${it}_${inputs.properties.archivesName}"}
rename {
"${it}_${inputs.properties.archivesName}"
}
}
}
// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
@@ -71,11 +67,5 @@ publishing {
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
repositories {}
}
+6 -3
View File
@@ -1,15 +1,18 @@
# v2.5
# v3.2
## novedades
- grupos de ajustes, para mayor orden, y arreglo de algún que otro bug
### adiciones
#### módulos nuevos:
- dupe de bundle: robado de .gg/dupes, usando un bundle y un libro de bookbot, dupea 63 del ítem deseado
- j. k. rowling: rellena libros con caca de manera automática
### arreglos / mejoras
- ahora el aviso de actualizaciones ya funciona bien
## problemas reconocidos
- muchos, pero repórtalos en la página de problemas si quieres para que queden bien registrados
+3
View File
@@ -7,6 +7,9 @@ Trouser Streak: https://github.com/etianl/Trouser-Streak
No More Purple: https://github.com/Pepperoni-Jabroni/NoMorePurple/
bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack
elytra-recast: https://github.com/InLieuOfLuna/elytra-recast/
SpearHax: https://github.com/etianl/spearHax/
ProjectileTrajectoryPreview: https://github.com/maDU59/ProjectilesTrajectoryPreview
DupersUnited public addon: https://discord.gg/dupes | https://dupers.wtf
probablemente más pero como tengo demencia se me olvida
si quieres que te acredite o quite tu código de mi mod, mándame un mensaje en discord (username: retucio) y sin problemas :)
+1 -1
View File
@@ -8,6 +8,6 @@ loom_version=1.13-SNAPSHOT
fabric_api_version=0.140.2+1.21.11
mod_version=2.5
mod_version=3.1
maven_group=me.retucio
archives_base_name=sputnik
Vendored Regular → Executable
View File
File mode changed.
+36 -4
View File
@@ -1,6 +1,6 @@
package me.retucio.sputnik;
import com.ibm.icu.text.CaseMap;
import me.retucio.sputnik.cape.CapeManager;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.command.commands.BindCommand;
@@ -10,6 +10,7 @@ import me.retucio.sputnik.config.ConfigManager;
import me.retucio.sputnik.event.EventBus;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.ShutdownEvent;
import me.retucio.sputnik.event.events.interact.OpenScreenEvent;
import me.retucio.sputnik.event.events.sputnik.LoadCapeManagerEvent;
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent;
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent;
@@ -19,8 +20,10 @@ import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.client.HUD;
import me.retucio.sputnik.ui.hud.HudRenderer;
import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.hud.HudEditorScreen;
import me.retucio.sputnik.ui.screen.UpdateScreen;
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
import me.retucio.sputnik.ui.widgets.buttons.SettingButton;
import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton;
@@ -29,9 +32,11 @@ import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
import me.retucio.sputnik.ui.widgets.Button;
import me.retucio.sputnik.util.*;
import me.retucio.sputnik.util.KeyUtil;
import me.retucio.sputnik.util.render.DrawUtil;
import me.retucio.sputnik.util.render.RenderUtil;
import me.retucio.sputnik.util.render.Textures;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
@@ -39,6 +44,7 @@ import net.minecraft.SharedConstants;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ChatScreen;
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.AbstractSignEditScreen;
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
@@ -47,6 +53,13 @@ import org.apache.logging.log4j.Logger;
import org.lwjgl.glfw.GLFW;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class Sputnik implements ClientModInitializer {
@@ -69,11 +82,18 @@ public class Sputnik implements ClientModInitializer {
private Screen prevScreen;
public static boolean settingsApplied = false;
static {
// puta vida
System.setProperty("java.awt.headless", "false");
}
@Override
public void onInitializeClient() {
mc = MinecraftClient.getInstance();
ConfigManager.load();
VersionChecker.check();
EVENT_BUS.register(this);
EVENT_BUS.register(ChatUtil.class);
@@ -85,6 +105,7 @@ public class Sputnik implements ClientModInitializer {
EVENT_BUS.register(RenderUtil.class);
Lists.init();
Textures.init();
CapeManager.INSTANCE = new CapeManager();
EVENT_BUS.post(new LoadCapeManagerEvent());
@@ -99,6 +120,8 @@ public class Sputnik implements ClientModInitializer {
HudEditorScreen.INSTANCE = new HudEditorScreen();
EVENT_BUS.post(new LoadClickGUIEvent());
mc.execute(HudRenderer::init);
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
EVENT_BUS.post(new ShutdownEvent());
}));
@@ -114,6 +137,7 @@ public class Sputnik implements ClientModInitializer {
}
ModuleManager.INSTANCE.getEnabledModules().forEach(Module::onTick);
mc.getWindow().setTitle(ClientSettingsFrame.guiSettings.windowTitle.getValue());
}
@@ -175,8 +199,6 @@ public class Sputnik implements ClientModInitializer {
if (key != ClientSettingsFrame.guiSettings.getKey() || anyFocused || isOnTypingScreen())
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) {
prevScreen = mc.currentScreen;
mc.setScreen(ClickGUI.INSTANCE);
@@ -189,7 +211,7 @@ public class Sputnik implements ClientModInitializer {
// manejar la lógica de apertura del editor de elementos del hud, con la misma lógica que handleClickGUIKey()
private void handleHudEditorKey(int key, boolean anyFocused) {
HUD hud = ModuleManager.INSTANCE.getModuleByClass(HUD.class);
if (key != hud.editorKey.getKey() || anyFocused || isOnTypingScreen()) return;
if (key != hud.editorKey.getValue() || anyFocused || isOnTypingScreen()) return;
if (mc.currentScreen != HudEditorScreen.INSTANCE) {
if (!hud.isEnabled()) {
@@ -220,6 +242,16 @@ public class Sputnik implements ClientModInitializer {
|| mc.currentScreen instanceof AbstractCommandBlockScreen;
}
// notificar al usuario de que hay una actualización disponible, si la hay
@SubscribeEvent
public void onSetScreen(OpenScreenEvent event) {
if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) {
event.cancel();
VersionChecker.shouldShowScreen = false;
mc.execute(() -> mc.currentScreen = new UpdateScreen());
}
}
@SubscribeEvent
public void onStop(ShutdownEvent event) {
ConfigManager.save();
@@ -32,16 +32,21 @@ public class CommandManager {
public static void registerCommands() {
addCommand(new BindCommand());
addCommand(new ClickSlotCommand());
addCommand(new ConfigCommand());
addCommand(new CopyScreenshotCommand());
addCommand(new EnderChestCommand());
addCommand(new GarbageCleanerCommand());
addCommand(new PeekCommand());
addCommand(new PluginsCommand());
addCommand(new PrefixCommand());
addCommand(new PurgeCommand());
addCommand(new RepeatCommand());
addCommand(new SaveScreenshotCommand());
addCommand(new SendCommand());
addCommand(new SpectateCommand());
addCommand(new ToggleCommand());
addCommand(new WaitCommand());
commands.sort(Comparator.comparing(Command::getName));
@@ -0,0 +1,46 @@
package me.retucio.sputnik.command.args;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
public class EnumArgumentType<T extends Enum<T>> implements ArgumentType<T> {
private static final DynamicCommandExceptionType NO_SUCH_TYPE = new DynamicCommandExceptionType((value) -> Text.of(" argumento inválido: " + value));
private final T[] values;
public EnumArgumentType(T defaultValue) {
this.values = defaultValue.getDeclaringClass().getEnumConstants();
}
public static <T extends Enum<T>> EnumArgumentType<T> enumArgument(T defaultValue) {
return new EnumArgumentType<>(defaultValue);
}
public static <T extends Enum<T>> T getEnum(CommandContext<?> context, String name, T defaultValue) {
return context.getArgument(name, defaultValue.getDeclaringClass());
}
public T parse(StringReader reader) throws CommandSyntaxException {
String argument = reader.readString();
return Arrays.stream(this.values)
.filter((value) -> value.toString().equals(argument))
.findFirst()
.orElseThrow(() -> NO_SUCH_TYPE.create(argument)
);
}
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
return CommandSource.suggestMatching(Arrays.stream(this.values).map(e -> e.toString().toLowerCase()), builder);
}
}
@@ -9,6 +9,7 @@ import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import me.retucio.sputnik.module.Module;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.util.MiscUtil;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
@@ -19,6 +20,7 @@ import java.util.concurrent.CompletableFuture;
public class ModuleArgumentType implements ArgumentType<Module> {
public static final ModuleArgumentType INSTANCE = new ModuleArgumentType();
private static final DynamicCommandExceptionType UNKNOWN_MODULE = new DynamicCommandExceptionType(
name -> Text.literal("módulo \"" + name + "\" no encontrado"));
@@ -35,7 +37,8 @@ public class ModuleArgumentType implements ArgumentType<Module> {
@Override
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
return CommandSource.suggestMatching(ModuleManager.INSTANCE.getModules().stream().map(module -> module.getName().replace(" ", "_")), builder);
return CommandSource.suggestMatching(ModuleManager.INSTANCE.getModules()
.stream().map(module -> MiscUtil.removeAccentMarks(module.getName().replace(" ", "_"))), builder);
}
@Override
@@ -42,7 +42,7 @@ public class BindCommand extends Command {
public static boolean onKeyPress(int key) {
if (listeningModule == null) return false;
KeySetting bind = listeningModule.getBind();
if (bind != null) bind.setKey(key);
if (bind != null) bind.setValue(key);
ChatUtil.info(
Text.of("la tecla " + Formatting.AQUA + KeyUtil.getKeyName(key) + Formatting.RESET +
@@ -0,0 +1,35 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.EnumArgumentType;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.command.CommandSource;
import net.minecraft.screen.slot.SlotActionType;
// https://cdn.discordapp.com/attachments/1456079799045980400/1457154232737206375/dupersunited-public-addon-1.21.11-3.1.3.jar?ex=69735be1&is=69720a61&hm=77fb6faee49762e0a812661f0d98931e89cb725db711c45722249d0efe3b91e4&
public class ClickSlotCommand extends Command {
public ClickSlotCommand() {
super("clickslot", "simula un clic a un slot");
}
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(argument("slot", IntegerArgumentType.integer())
.then(argument("botón", IntegerArgumentType.integer())
.then(argument("acción", EnumArgumentType.enumArgument(SlotActionType.SWAP))
.executes(context -> {
int slot = context.getArgument("slot", Integer.class), button = context.getArgument("botón", Integer.class);
SlotActionType action = context.getArgument("acción", SlotActionType.class);
Screen screen = mc.currentScreen;
int syncId = (screen instanceof GenericContainerScreen gcScreen) ? gcScreen.getScreenHandler().syncId : 0;
mc.interactionManager.clickSlot(syncId, slot, button, action, mc.player);
return SUCCESS;
})
)
)
);
}
}
@@ -0,0 +1,66 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.ModuleArgumentType;
import me.retucio.sputnik.ui.screen.ClickGUI;
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
import net.minecraft.command.CommandSource;
import me.retucio.sputnik.module.Module;
public class ConfigCommand extends Command {
public ConfigCommand() {
super("config", "abre el marco de ajustes de un módulo", "ajustes", "settings");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder
.then(argument("módulo", ModuleArgumentType.INSTANCE)
.executes(ctx -> {
mc.execute(() -> openSf(ctx));
return SUCCESS;
})
.then(argument("x", IntegerArgumentType.integer())
.then(argument("y", IntegerArgumentType.integer())
.executes(ctx -> {
mc.execute(() -> openSfWithPos(ctx,
ctx.getArgument("x", Integer.class),
ctx.getArgument("y", Integer.class)));
return SUCCESS;
})
)
)
);
}
private void openSf(CommandContext<CommandSource> ctx) {
Module module = ctx.getArgument("módulo", Module.class);
mc.setScreen(ClickGUI.INSTANCE);
if (ClickGUI.INSTANCE.isSettingsFrameOpen(module)) return;
SettingsFrame sf = ClickGUI.INSTANCE.getSfOfModule(module);
int x = mc.getWindow().getScaledWidth() / 2 - sf.getW() / 2;
int y = 67;
ClickGUI.INSTANCE.openSettingsFrame(module, x, y);
}
private void openSfWithPos(CommandContext<CommandSource> ctx, int x, int y) {
Module module = ctx.getArgument("módulo", Module.class);
mc.setScreen(ClickGUI.INSTANCE);
if (ClickGUI.INSTANCE.isSettingsFrameOpen(module)) {
SettingsFrame sf = ClickGUI.INSTANCE.getSfOfModule(module);
sf.setX(x);
sf.setY(y);
}
ClickGUI.INSTANCE.openSettingsFrame(module, x, y);
}
}
@@ -0,0 +1,113 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.tree.CommandNode;
import com.mojang.brigadier.tree.RootCommandNode;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.network.PacketEvent;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.client.network.ClientCommandSource;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.play.CommandTreeS2CPacket;
import java.util.HashSet;
import java.util.Set;
public class PluginsCommand extends Command {
private final Set<String> plugins = new HashSet<>();
private boolean scanning = false;
public PluginsCommand() {
super("plugins", "busca los plugins que tenga el server", "pl", "serverplugins");
Sputnik.EVENT_BUS.subscribe(this);
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
if (mc.isIntegratedServerRunning()) {
ChatUtil.error("estás en un solo jugador");
return SUCCESS;
}
if (scanning) {
ChatUtil.error("calmaaa");
return SUCCESS;
}
plugins.clear();
scanning = true;
findNamespaces();
return SUCCESS;
});
}
private void findNamespaces() {
try {
ClientPlayNetworkHandler networkHandler = mc.getNetworkHandler();
if (networkHandler == null || networkHandler.getCommandDispatcher() == null) {
return;
}
RootCommandNode<ClientCommandSource> root = networkHandler.getCommandDispatcher().getRoot();
root.getChildren().forEach(this::checkNodeForPlugins);
if (!plugins.isEmpty()) {
ChatUtil.info(plugins.size() + " namespace(s) encontrado(s) de comandos:");
plugins.stream()
.sorted()
.forEach(plugin -> ChatUtil.info(" - " + plugin));
}
displayResults();
} catch (Exception e) {
ChatUtil.error("error analizando comandos: " + e.getMessage());
}
}
private void checkNodeForPlugins(CommandNode<ClientCommandSource> node) {
String name = node.getName();
if (name.contains(":")) {
String namespace = name.split(":")[0];
if (!namespace.equalsIgnoreCase("minecraft")
&& !namespace.equalsIgnoreCase("bukkit")
&& !namespace.equalsIgnoreCase("spigot")
&& !namespace.equalsIgnoreCase("paper")) {
plugins.add(namespace);
}
}
node.getChildren().forEach(this::checkNodeForPlugins);
}
@SubscribeEvent
private void onPacketReceive(PacketEvent.Receive event) {
if (!scanning) return;
if (event.getPacket() instanceof CommandTreeS2CPacket) {
findNamespaces();
}
}
private void displayResults() {
if (!plugins.isEmpty()) {
ChatUtil.info(plugins.size() + " plugin(s) encontrado(s)");
plugins.stream().sorted()
.forEach(plugin -> ChatUtil.info(" - " + plugin));
} else {
ChatUtil.warn("sin plugins (probablemente)");
}
scanning = false;
}
}
@@ -0,0 +1,32 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.command.CommandSource;
public class RepeatCommand extends Command {
public RepeatCommand() {
super("repetir", "repite un comando x veces", "repeat");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder
.then(argument("veces", IntegerArgumentType.integer(1))
.then(argument("comando", StringArgumentType.greedyString())
.executes(ctx -> {
int j = ctx.getArgument("veces", Integer.class);
String command = ctx.getArgument("comando", String.class);
for (int i = 0; i < j; i++) {
ChatUtil.simulateChatMessage(command);
}
return SUCCESS;
})
)
);
}
}
@@ -3,7 +3,7 @@ package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
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.command.CommandSource;
import net.minecraft.network.encryption.NetworkEncryptionUtils;
@@ -4,7 +4,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.args.EntityArgumentType;
import me.retucio.sputnik.event.SubscribeEvent;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.event.events.input.KeyEvent;
import me.retucio.sputnik.util.EntityUtil;
import net.minecraft.command.CommandSource;
import net.minecraft.entity.Entity;
@@ -0,0 +1,40 @@
package me.retucio.sputnik.command.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.retucio.sputnik.command.Command;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
import me.retucio.sputnik.util.ChatUtil;
import net.minecraft.command.CommandSource;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class WaitCommand extends Command {
private static final ScheduledExecutorService DELAYED_EXECUTOR = new ScheduledThreadPoolExecutor(2);
public WaitCommand() {
super("wait", "espera un tiempo determinado antes de ejecutar otro comando", "esperar", "sleep", "delay");
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder
.then(argument("delay", IntegerArgumentType.integer(0))
.then(argument("comando", StringArgumentType.greedyString())
.executes(ctx -> {
int delay = ctx.getArgument("delay", Integer.class);
String command = ctx.getArgument("comando", String.class);
DELAYED_EXECUTOR.schedule(() -> ChatUtil.simulateChatMessage(command), delay, TimeUnit.MILLISECONDS);
return SUCCESS;
})
)
);
}
}
@@ -57,9 +57,9 @@ public class ClientConfig {
// guardar ajustes con su respectivo tipo de valor, en formato "nombreMódulo:nombreAjuste"
Object value = null;
switch (event.getSetting()) {
case BooleanSetting b: value = b.isEnabled(); break;
case BooleanSetting b: value = b.getValue(); break;
case EnumSetting e: value = e.getIndex(); break;
case KeySetting k: value = k.getKey(); break;
case KeySetting k: value = k.getValue(); break;
case NumberSetting n: value = n.getValue(); break;
case StringSetting s: value = s.getValue(); break;
case ListSetting l: value = l.getConfigValues(); break;
@@ -107,7 +107,7 @@ public class ConfigManager {
save();
}
public static void setSetting(Setting setting, Object value) {
public static void setSetting(Setting<?> setting, Object value) {
ensureConfig();
config.settings.put(getSettingKey(setting), value);
save();
@@ -150,7 +150,7 @@ public class ConfigManager {
// ------------------ APLICAR AJUSTES ------------------
@SuppressWarnings({"rawtypes", "unchecked"})
public static void applySetting(Module parent, Setting setting) {
public static void applySetting(Module parent, Setting<?> setting) {
String key = getSettingKey(setting);
if (!config.settings.containsKey(key)) return;
@@ -189,8 +189,15 @@ public class ConfigManager {
private static void applySettingsFrames() {
config.settingsFrames.forEach((moduleName, position) -> {
Module module = ModuleManager.INSTANCE.getModuleByName(moduleName);
if (module == null) {
Sputnik.LOGGER.warn("\"null\" como módulo (\"{}\")", moduleName);
return;
}
ClickGUI.INSTANCE.openSettingsFrame(module, position[0], position[1]);
});
Sputnik.LOGGER.info("estados de marcos de ajustes aplicados");
}
@@ -242,7 +249,7 @@ public class ConfigManager {
private static void applyBooleanSetting(BooleanSetting setting, Object value) {
if (value instanceof Boolean) {
setting.setEnabled((Boolean) value);
setting.setValue((Boolean) value);
}
}
@@ -268,9 +275,9 @@ public class ConfigManager {
private static void applyKeySetting(KeySetting setting, Object value) {
if (value instanceof Double) {
setting.setKey(((Double) value).intValue());
setting.setValue(((Double) value).intValue());
} else if (value instanceof Integer) {
setting.setKey((Integer) value);
setting.setValue((Integer) value);
}
}
@@ -284,7 +291,7 @@ public class ConfigManager {
convertedValues.put(option, booleanValue instanceof Boolean && (Boolean) booleanValue);
}
setting.setValues(convertedValues);
setting.setValue(convertedValues);
}
}
@@ -335,8 +342,8 @@ public class ConfigManager {
if (config == null) config = new ClientConfig();
}
private static String getSettingKey(Setting setting) {
return setting.getSg().getModule().getName() + ":" + setting.getName();
private static String getSettingKey(Setting<?> setting) {
return setting.getSg().getModule().getName() + ":" + setting.getTrueName();
}
public static boolean hasLoaded() {
@@ -1,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,10 +1,11 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onStop
* @see MinecraftClientMixin#onStop
*/
public class ShutdownEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPre
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPost
* @see MinecraftClientMixin#onTickPre
* @see MinecraftClientMixin#onTickPost
*/
public class TickEvent {
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import net.minecraft.text.ClickEvent;
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.io.KeyboardMixin;
/**
* @see me.retucio.sputnik.mixin.KeyboardMixin#onKeyPress
* @see KeyboardMixin#onKeyPress
*/
public class KeyEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
/**
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseButton
* @see MouseMixin#onMouseButton
*/
public class MouseClickEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.input;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
/**
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseScroll
* @see MouseMixin#onMouseScroll
*/
public class MouseScrollEvent extends Event {
@@ -0,0 +1,24 @@
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
public class AttackBlockEvent extends Event {
private final BlockPos pos;
private final Direction dir;
public AttackBlockEvent(BlockPos pos, Direction dir) {
this.pos = pos;
this.dir = dir;
}
public BlockPos getPos() {
return pos;
}
public Direction getDir() {
return dir;
}
}
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.entity.Entity;
/**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onAttackEntity
* @see ClientPlayerInteractionManagerMixin#onAttackEntity
*/
public class AttackEntityEvent extends Event {
@@ -0,0 +1,43 @@
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
public class BlockShapeEvent extends Event {
private BlockState state;
private BlockPos pos;
private VoxelShape shape;
public BlockShapeEvent(BlockState state, BlockPos pos, VoxelShape shape) {
this.state = state;
this.pos = pos;
this.setShape(shape);
}
public BlockState getState() {
return state;
}
public void setState(BlockState state) {
this.state = state;
}
public BlockPos getPos() {
return pos;
}
public void setPos(BlockPos pos) {
this.pos = pos;
}
public VoxelShape getShape() {
return shape;
}
public void setShape(VoxelShape shape) {
this.shape = shape;
}
}
@@ -0,0 +1,28 @@
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.util.math.Vec3d;
public class BoatMoveEvent extends Event {
private final AbstractBoatEntity boat;
private Vec3d pos;
public BoatMoveEvent(AbstractBoatEntity boat, Vec3d pos) {
this.boat = boat;
this.pos = pos;
}
public AbstractBoatEntity getBoat() {
return boat;
}
public Vec3d getPos() {
return pos;
}
public void setPos(Vec3d pos) {
this.pos = pos;
}
}
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.util.math.BlockPos;
/**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockBreak
* @see ClientPlayerInteractionManagerMixin#onBlockBreak
*/
public class BreakBlockEvent extends Event {
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.item.ItemStackMixin;
import net.minecraft.item.ItemStack;
/**
* @see me.retucio.sputnik.mixin.ItemStackMixin#onDamage
* @see ItemStackMixin#onDamage
*/
public class DamageItemEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.entity.Entity;
import net.minecraft.util.Hand;
/**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onEntityInteract
* @see ClientPlayerInteractionManagerMixin#onEntityInteract
*/
public class InteractEntityEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
import net.minecraft.client.gui.screen.Screen;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onOpenScreen
* @see MinecraftClientMixin#onOpenScreen
*/
public class OpenScreenEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
/**
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockPlace
* @see ClientPlayerInteractionManagerMixin#onBlockPlace
*/
public class PlaceBlockEvent extends Event {
@@ -0,0 +1,26 @@
package me.retucio.sputnik.event.events.interact;
import me.retucio.sputnik.event.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.events.interact;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onUseItem
* @see MinecraftClientMixin#onUseItem
*/
public class UseItemEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
import net.minecraft.entity.Entity;
/**
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onAddEntity
* @see ClientWorldMixin#onAddEntity
*/
public class AddEntityEvent extends Event {
@@ -0,0 +1,10 @@
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.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.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.network.DisconnectionInfo;
/**
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onDisconnect
* @see ClientConnectionMixin#onDisconnect
*/
public class DisconnectEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
import net.minecraft.client.world.ClientWorld;
/**
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onJoinWorld
* @see MinecraftClientMixin#onJoinWorld
*/
public class JoinWorldEvent extends Event {
@@ -1,14 +1,15 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.event.Stage;
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
import net.minecraft.network.packet.Packet;
/**
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPre
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPost
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onReceivePacket
* @see ClientConnectionMixin#onSendPacketPre
* @see ClientConnectionMixin#onSendPacketPost
* @see ClientConnectionMixin#onReceivePacket
*/
public class PacketEvent {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.hud.ChatHudMixin;
import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.text.Text;
/**
* @see me.retucio.sputnik.mixin.ChatHudMixin#onAddMessage
* @see ChatHudMixin#onAddMessage
*/
public class ReceiveMessageEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
import net.minecraft.entity.Entity;
/**
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onRemoveEntity
* @see ClientWorldMixin#onRemoveEntity
*/
public class RemoveEntityEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.network;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.network.ClientPlayNetworkHandlerMixin;
/**
* @see me.retucio.sputnik.mixin.ClientPlayNetworkHandlerMixin#onSendMessage
* @see ClientPlayNetworkHandlerMixin#onSendMessage
*/
public class SendMessageEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
/**
* @see me.retucio.sputnik.mixin.EntityMixin#onRotation
* @see me.retucio.sputnik.mixin.EntityMixin#onChangeYaw
* @see me.retucio.sputnik.mixin.EntityMixin#onChangePitch
* @see EntityMixin#onRotation
* @see EntityMixin#onChangeYaw
* @see EntityMixin#onChangePitch
*/
public class ChangeRotationEvent extends Event {
@@ -1,10 +1,11 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.render.GameRendererMixin;
/**
* @see me.retucio.sputnik.mixin.GameRendererMixin#modifyFov
* @see GameRendererMixin#modifyFov
*/
public class GetFOVEvent extends Event {
@@ -1,11 +1,12 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.misc.GameOptionsMixin;
import net.minecraft.client.option.Perspective;
/**
* @see me.retucio.sputnik.mixin.GameOptionsMixin#changePerspective
* @see GameOptionsMixin#changePerspective
*/
public class PerspectiveChangeEvent extends Event {
@@ -1,4 +1,4 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import net.minecraft.client.gui.DrawContext;
@@ -1,13 +1,14 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.render.WorldRendererMixin;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.util.math.MatrixStack;
/**
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render
* @see WorldRendererMixin#render
*/
public class Render3DEvent extends Event {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Hand;
/**
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderArm
* @see HeldItemRendererMixin#onRenderArm
*/
public class RenderArmEvent extends Event {
@@ -0,0 +1,30 @@
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
public class RenderBlockOutlineEvent extends Event {
private int color;
private float lineWidth;
public RenderBlockOutlineEvent(int color, float lineWidth) {
this.color = color;
this.lineWidth = lineWidth;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public float getLineWidth() {
return lineWidth;
}
public void setLineWidth(float lineWidth) {
this.lineWidth = lineWidth;
}
}
@@ -1,6 +1,7 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.hud.BossBarHudMixin;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
@@ -8,9 +9,9 @@ import java.util.Iterator;
/**
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarIterator
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarName
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifySpacingConstant
* @see BossBarHudMixin#modifyBossBarIterator
* @see BossBarHudMixin#modifyBossBarName
* @see BossBarHudMixin#modifySpacingConstant
*/
public class RenderBossbarEvent {
@@ -1,12 +1,13 @@
package me.retucio.sputnik.event.events;
package me.retucio.sputnik.event.events.render;
import me.retucio.sputnik.event.Event;
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Hand;
/**
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderItem
* @see HeldItemRendererMixin#onRenderItem
*/
public class RenderHeldItemEvent extends Event {
@@ -6,15 +6,15 @@ import me.retucio.sputnik.module.setting.Setting;
// se genera cada que se cambia el valor de un ajuste
public class UpdateSettingEvent extends Event {
private final Setting setting;
private final Setting<?> setting;
private boolean shouldSave;
public UpdateSettingEvent(Setting setting, boolean shouldSave) {
public UpdateSettingEvent(Setting<?> setting, boolean shouldSave) {
this.setting = setting;
this.shouldSave = shouldSave;
}
public Setting getSetting() {
public Setting<?> getSetting() {
return setting;
}
@@ -0,0 +1,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.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.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.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.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.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.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.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 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 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.events.interact.BoatMoveEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.movement.BoatFly;
import net.minecraft.entity.MovementType;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(AbstractBoatEntity.class)
public abstract class AbstractBoatEntityMixin {
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/AbstractBoatEntity;move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V"))
private void onMove(AbstractBoatEntity instance, MovementType movementType, Vec3d vec3d) {
BoatMoveEvent event = Sputnik.EVENT_BUS.post(new BoatMoveEvent(instance, vec3d));
if(!event.isCancelled()) instance.move(movementType, event.getPos());
}
@Inject(method = "updatePaddles", at = @At("HEAD"), cancellable = true)
private void onPaddle(CallbackInfo ci) {
if (ModuleManager.INSTANCE.getModuleByClass(BoatFly.class).isEnabled()) {
ci.cancel();
}
}
}
@@ -1,17 +1,19 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.entity;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import me.retucio.sputnik.event.events.ChangeRotationEvent;
import me.retucio.sputnik.event.events.render.ChangeRotationEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import me.retucio.sputnik.module.modules.camera.Freelook;
import me.retucio.sputnik.module.modules.camera.Rotations;
import me.retucio.sputnik.module.modules.misc.AntiInvis;
import me.retucio.sputnik.module.modules.movement.BoatFly;
import me.retucio.sputnik.module.modules.render.Nametags;
import net.minecraft.entity.*;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.PersistentProjectileEntity;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.world.World;
@@ -88,7 +90,7 @@ public abstract class EntityMixin {
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
private Text showProjectileDamage(Text original) {
if (!nametags.isEnabled() || !nametags.showProjectileDamage.isEnabled()) return original;
if (!nametags.isEnabled() || !nametags.showProjectileDamage.getValue()) return original;
if ((Object) this instanceof PersistentProjectileEntity arrow) { // aunque lo llame "arrow", también cubre flechas espectrales y tridentes
String damage = nametags.getArrowDamage(arrow);
@@ -98,10 +100,19 @@ public abstract class EntityMixin {
return original;
}
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
private Text showTntPrimeTime(Text original) {
if (!nametags.isEnabled() || !nametags.tntPrime.getValue()) return original;
if ((Object) this instanceof TntEntity tnt) {
return Text.of(nametags.getTntPrimeTime(tnt));
}
return original;
}
@SuppressWarnings("ConstantConditions")
@ModifyReturnValue(method = "getCustomName", at = @At("RETURN"))
private Text displayEntityOwner(Text original) {
if (!nametags.isEnabled() || !nametags.petOwner.isEnabled()) return original;
if (!nametags.isEnabled() || !nametags.petOwner.getValue()) return original;
if ((Object) this instanceof TameableEntity entity && entity.getOwnerReference() != null) {
if (original != null) return original.copy().append(" (de " + nametags.getOwnerName(entity.getOwnerReference()) + ")");
else return Text.of(nametags.getOwnerName(entity.getOwnerReference()));
@@ -113,7 +124,7 @@ public abstract class EntityMixin {
@SuppressWarnings("ConstantConditions")
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
private Text showBabies(Text original) {
if (!nametags.isEnabled() || !nametags.distinguishBabies.isEnabled()) return original;
if (!nametags.isEnabled() || !nametags.distinguishBabies.getValue()) return original;
if ((Object) this instanceof LivingEntity entity && entity.isBaby()) return original.copy().append(" (baby)");
return original;
}
@@ -146,7 +157,16 @@ public abstract class EntityMixin {
// otros
@Inject(method = "isInvisibleTo", at = @At("RETURN"), cancellable = true)
public void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
private void renderInvisPlayers(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) {
if (ModuleManager.INSTANCE.getModuleByClass(AntiInvis.class).isEnabled()) cir.setReturnValue(false);
}
@SuppressWarnings("ConstantConditions")
@Inject(method = "getStepHeight", at = @At("RETURN"), cancellable = true)
private void modifyBoatStepHeight(CallbackInfoReturnable<Float> cir) {
BoatFly boatFly = ModuleManager.INSTANCE.getModuleByClass(BoatFly.class);
if (((Object) this) instanceof AbstractBoatEntity && boatFly.isEnabled()) {
cir.setReturnValue(boatFly.stepHeight.getFloatValue());
}
}
}
@@ -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 me.retucio.sputnik.module.ModuleManager;
@@ -28,7 +28,7 @@ public abstract class ItemEntityMixin {
if (!name.equals(original)) name = name.formatted(Formatting.ITALIC);
if (nametags.countItems.isEnabled()) {
if (nametags.countItems.getValue()) {
if (count > 1) return name.copy().append(" x" + count);
return name;
}
@@ -1,7 +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.modules.player.ElytraBounce;
import me.retucio.sputnik.module.modules.movement.ElytraBounce;
import me.retucio.sputnik.module.modules.movement.Step;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.sound.SoundCategory;
@@ -12,6 +13,7 @@ import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import static me.retucio.sputnik.Sputnik.mc;
@@ -26,7 +28,7 @@ public abstract class LivingEntityMixin {
@SuppressWarnings("ConstantConditions")
@Inject(method = "tickMovement", at = @At("TAIL"))
public void recastIfLanded(CallbackInfo ci) {
private void recastIfLanded(CallbackInfo ci) {
ElytraBounce bounce = ModuleManager.INSTANCE.getModuleByClass(ElytraBounce.class);
if (!((Object) this instanceof ClientPlayerEntity)
@@ -47,4 +49,11 @@ public abstract class LivingEntityMixin {
prevElytra = elytra;
}
@Inject(method = "getStepHeight", at = @At("RETURN"), cancellable = true)
private void step(CallbackInfoReturnable<Float> cir) {
Step step = ModuleManager.INSTANCE.getModuleByClass(Step.class);
if (step.isEnabled()) cir.setReturnValue(step.height.getFloatValue());
}
}
@@ -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.sugar.Local;
import me.retucio.sputnik.event.events.RenderBossbarEvent;
import me.retucio.sputnik.event.events.render.RenderBossbarEvent;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
@@ -15,7 +15,8 @@ import java.util.Iterator;
import static me.retucio.sputnik.Sputnik.EVENT_BUS;
@Mixin(BossBarHud.class)
@Mixin(value = BossBarHud.class)
public abstract class BossBarHudMixin {
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/Collection;iterator()Ljava/util/Iterator;"))
@@ -30,7 +31,8 @@ public abstract class BossBarHudMixin {
return event.getName();
}
@ModifyConstant(method = "render", constant = @Constant(intValue = 9, ordinal = 1))
// require = 0 para meteor
@ModifyConstant(method = "render", constant = @Constant(intValue = 9, ordinal = 1), require = 0)
public int modifySpacingConstant(int constant) {
RenderBossbarEvent.BossSpacing event = EVENT_BUS.post(new RenderBossbarEvent.BossSpacing(constant));
return event.getSpacing();
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.hud;
import com.mojang.authlib.GameProfile;
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 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.sugar.Local;
import me.retucio.sputnik.event.events.ReceiveMessageEvent;
import me.retucio.sputnik.event.events.network.ReceiveMessageEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import me.retucio.sputnik.util.interfaces.IChatHud;
@@ -143,7 +143,7 @@ public abstract class ChatHudMixin implements IChatHud {
@ModifyExpressionValue(method = "render(Lnet/minecraft/client/gui/hud/ChatHud$Backend;IIZ)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;ceil(F)I"))
private int onRender_modifyWidth(int width) {
return (chatPlus.isEnabled() && chatPlus.showHeads.isEnabled()) ? width + 10 : width;
return (chatPlus.isEnabled() && chatPlus.showHeads.getValue()) ? width + 10 : width;
}
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.hud;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.Render2DEvent;
import me.retucio.sputnik.event.events.render.Render2DEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
import me.retucio.sputnik.module.modules.camera.Freecam;
@@ -40,32 +40,32 @@ public abstract class InGameHudMixin {
@Inject(method = "renderScoreboardSidebar*", at = @At("HEAD"), cancellable = true)
private void noRenderScoreboard(CallbackInfo ci) {
if (noRender.isEnabled() && !noRender.scoreboard.isEnabled()) ci.cancel();
if (noRender.isEnabled() && !noRender.scoreboard.getValue()) ci.cancel();
}
@Inject(method = "renderTitleAndSubtitle", at = @At("HEAD"), cancellable = true)
private void noRenderTitles(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
if (noRender.isEnabled() && !noRender.titles.isEnabled()) ci.cancel();
if (noRender.isEnabled() && !noRender.titles.getValue()) ci.cancel();
}
@Inject(method = "renderNauseaOverlay", at = @At("HEAD"), cancellable = true)
private void noRenderNausea(DrawContext context, float nauseaStrength, CallbackInfo ci) {
if (noRender.isEnabled() && !noRender.nauseaEffect.isEnabled()) ci.cancel();
if (noRender.isEnabled() && !noRender.nauseaEffect.getValue()) ci.cancel();
}
@Inject(method = "renderSpyglassOverlay", at = @At("HEAD"), cancellable = true)
private void noRenderSpyglass(DrawContext context, float scale, CallbackInfo ci) {
if (noRender.isEnabled() && !noRender.spyglassOverlay.isEnabled()) ci.cancel();
if (noRender.isEnabled() && !noRender.spyglassOverlay.getValue()) ci.cancel();
}
@Inject(method = "renderPortalOverlay", at = @At("HEAD"), cancellable = true)
private void noRenderPortal(DrawContext context, float nauseaStrength, CallbackInfo ci) {
if (noRender.isEnabled() && !noRender.portalOverlay.isEnabled()) ci.cancel();
if (noRender.isEnabled() && !noRender.portalOverlay.getValue()) ci.cancel();
}
@Inject(method = "renderOverlay", at = @At("HEAD"), cancellable = true)
private void noRenderPumpkinBlur(DrawContext context, Identifier texture, float opacity, CallbackInfo ci) {
if (noRender.isEnabled() && !noRender.pumpkinOverlay.isEnabled() && texture.getPath().equals("textures/misc/pumpkinblur.png")) ci.cancel();
if (noRender.isEnabled() && !noRender.pumpkinOverlay.getValue() && texture.getPath().equals("textures/misc/pumpkinblur.png")) ci.cancel();
}
@@ -84,6 +84,6 @@ public abstract class InGameHudMixin {
@Inject(method = "clear", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;clear(Z)V"), cancellable = true)
private void onClear(CallbackInfo ci) {
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
if (chatPlus.isEnabled() && chatPlus.keepHistory.isEnabled()) ci.cancel();
if (chatPlus.isEnabled() && chatPlus.keepHistory.getValue()) ci.cancel();
}
}
@@ -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.modules.camera.Freecam;
@@ -16,7 +16,7 @@ public abstract class KeyInputMixin extends Input {
@Inject(method = "tick", at = @At("TAIL"))
private void isPressed(CallbackInfo ci) {
Freecam freecam = ModuleManager.INSTANCE.getModuleByClass(Freecam.class);
if (freecam.isEnabled() && freecam.stayCrouching.isEnabled() && freecam.isCrouching())
if (freecam.isEnabled() && freecam.stayCrouching.getValue() && freecam.isCrouching())
playerInput = new PlayerInput(
false, false,
false, false,
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.io;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.KeyEvent;
import me.retucio.sputnik.event.events.input.KeyEvent;
import net.minecraft.client.Keyboard;
import net.minecraft.client.input.KeyInput;
import org.spongepowered.asm.mixin.Mixin;
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.io;
import me.retucio.sputnik.event.events.MouseClickEvent;
import me.retucio.sputnik.event.events.MouseScrollEvent;
import me.retucio.sputnik.event.events.input.MouseClickEvent;
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
import net.minecraft.client.Mouse;
import net.minecraft.client.input.MouseInput;
import org.spongepowered.asm.mixin.Mixin;
@@ -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.modules.misc.ScreenshotPlus;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.item;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ShulkerPeek;
@@ -23,7 +23,7 @@ public abstract class ItemMixin {
@Inject(method = "appendTooltip", at = @At("HEAD"))
private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplayComponent displayComponent, Consumer<Text> textConsumer, TooltipType type, CallbackInfo ci) {
ShulkerPeek shulkerPeek = ModuleManager.INSTANCE.getModuleByClass(ShulkerPeek.class);
if (!shulkerPeek.isEnabled() || !shulkerPeek.showTooltips.isEnabled()) return;
if (!shulkerPeek.isEnabled() || !shulkerPeek.showTooltips.getValue()) return;
if (stack.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof ShulkerBoxBlock) {
if (ShulkerPeek.isShulkerEmpty(stack)) {
@@ -1,6 +1,6 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.item;
import me.retucio.sputnik.event.events.DamageItemEvent;
import me.retucio.sputnik.event.events.interact.DamageItemEvent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
@@ -0,0 +1,35 @@
package me.retucio.sputnik.mixin.mixins.item;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.movement.TridentBoost;
import net.minecraft.item.TridentItem;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
@Mixin(TridentItem.class)
public abstract class TridentItemMixin {
@ModifyArgs(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;addVelocity(DDD)V"))
private void modifyVelocity(Args args) {
TridentBoost tridentBoost = ModuleManager.INSTANCE.getModuleByClass(TridentBoost.class);
if (!tridentBoost.isEnabled()) return;
args.set(0, (double) args.get(0) * tridentBoost.multiplier.getValue());
args.set(1, (double) args.get(1) * tridentBoost.multiplier.getValue());
args.set(2, (double) args.get(2) * tridentBoost.multiplier.getValue());
}
@ModifyExpressionValue(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isTouchingWaterOrRain()Z"))
private boolean allowUseOutOfWaterPre(boolean original) {
TridentBoost tridentBoost = ModuleManager.INSTANCE.getModuleByClass(TridentBoost.class);
return (tridentBoost.outOfWater.getValue() && tridentBoost.isEnabled()) || original;
}
@ModifyExpressionValue(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isTouchingWaterOrRain()Z"))
private boolean allowUseOutOfWaterPost(boolean original) {
TridentBoost tridentBoost = ModuleManager.INSTANCE.getModuleByClass(TridentBoost.class);
return (tridentBoost.outOfWater.getValue() && tridentBoost.isEnabled()) || original;
}
}
@@ -0,0 +1,39 @@
package me.retucio.sputnik.mixin.mixins.misc;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.render.Fonts;
import net.minecraft.client.font.FontManager;
import net.minecraft.client.font.FontStorage;
import net.minecraft.text.StyleSpriteSource;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(FontManager.class)
public abstract class FontManagerMixin {
@Shadow
public abstract FontStorage getStorageInternal(Identifier id);
@Inject(method = "getStorageInternal", at = @At("HEAD"), cancellable = true)
private void onGetStorageInternal(Identifier id, CallbackInfoReturnable<FontStorage> cir) {
Fonts fonts = ModuleManager.INSTANCE.getModuleByClass(Fonts.class);
if (!fonts.isEnabled()) return;
if (id.equals(StyleSpriteSource.Font.DEFAULT.id())) {
cir.setReturnValue(getStorageInternal(
Identifier.of(
Sputnik.MOD_ID,
fonts.getFont()
)
));
}
}
}
@@ -1,6 +1,6 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.misc;
import me.retucio.sputnik.event.events.PerspectiveChangeEvent;
import me.retucio.sputnik.event.events.render.PerspectiveChangeEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.camera.Freecam;
import net.minecraft.client.option.GameOptions;
@@ -1,22 +1,24 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.misc;
import com.llamalad7.mixinextras.sugar.Local;
import me.retucio.sputnik.Sputnik;
import me.retucio.sputnik.event.events.JoinWorldEvent;
import me.retucio.sputnik.event.events.OpenScreenEvent;
import me.retucio.sputnik.event.events.network.JoinWorldEvent;
import me.retucio.sputnik.event.events.interact.OpenScreenEvent;
import me.retucio.sputnik.event.events.ShutdownEvent;
import me.retucio.sputnik.event.events.TickEvent;
import me.retucio.sputnik.event.events.UseItemEvent;
import me.retucio.sputnik.event.events.interact.UseItemEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.player.FastUse;
import me.retucio.sputnik.ui.screen.UpdateScreen;
import me.retucio.sputnik.util.VersionChecker;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import org.jspecify.annotations.Nullable;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@@ -27,6 +29,16 @@ public abstract class MinecraftClientMixin {
@Shadow
private int itemUseCooldown;
@Shadow
public int attackCooldown;
// eventos
@Shadow
@Nullable
public Screen currentScreen;
@Inject(method = "tick", at = @At("HEAD"))
private void onTickPre(CallbackInfo ci) {
Sputnik.INSTANCE.onTick();
@@ -49,9 +61,10 @@ public abstract class MinecraftClientMixin {
if (event.isCancelled()) ci.cancel();
}
@Inject(method = "isTelemetryEnabledByApi", at = @At("RETURN"), cancellable = true)
private void disableMicropenisTelemetryShi(CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(false);
@Inject(method = "joinWorld", at = @At("HEAD"), cancellable = true)
private void onJoinWorld(ClientWorld world, CallbackInfo ci) {
JoinWorldEvent event = Sputnik.EVENT_BUS.post(new JoinWorldEvent(world));
if (event.isCancelled()) ci.cancel();
}
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;getStackInHand(Lnet/minecraft/util/Hand;)Lnet/minecraft/item/ItemStack;"), cancellable = true)
@@ -61,16 +74,20 @@ public abstract class MinecraftClientMixin {
if (event.isCancelled()) ci.cancel();
}
// telemetría
@Inject(method = "isTelemetryEnabledByApi", at = @At("RETURN"), cancellable = true)
private void disableMicropenisTelemetryShi(CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(false);
}
// precoz
@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Z"))
private void modifyItemUseCooldown(CallbackInfo ci, @Local ItemStack stack) {
FastUse fastUse = ModuleManager.INSTANCE.getModuleByClass(FastUse.class);
if (!fastUse.isEnabled()) return;
itemUseCooldown = fastUse.getCooldown(stack);
}
@Inject(method = "joinWorld", at = @At("HEAD"), cancellable = true)
private void onJoinWorld(ClientWorld world, CallbackInfo ci) {
JoinWorldEvent event = Sputnik.EVENT_BUS.post(new JoinWorldEvent(world));
if (event.isCancelled()) ci.cancel();
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.misc;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.misc.ChatPlus;
@@ -13,6 +13,6 @@ public abstract class StringHelperMixin {
@ModifyArg(method = "truncateChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringHelper;truncate(Ljava/lang/String;IZ)Ljava/lang/String;"), index = 1)
private static int onTruncate(int maxLength) {
ChatPlus chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
return ((chatPlus.isEnabled() && chatPlus.noCharLimit.isEnabled()) ? Integer.MAX_VALUE : maxLength);
return ((chatPlus.isEnabled() && chatPlus.noCharLimit.getValue()) ? Integer.MAX_VALUE : maxLength);
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.misc;
import me.retucio.sputnik.util.interfaces.IVec3d;
import net.minecraft.util.math.Vec3d;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.brigadier.ParseResults;
@@ -1,7 +1,7 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import me.retucio.sputnik.mixin.accessor.ConfirmServerResourcePackScreenAccessor;
import me.retucio.sputnik.mixin.accessor.PackAccessor;
import me.retucio.sputnik.mixin.accessors.ConfirmServerResourcePackScreenAccessor;
import me.retucio.sputnik.mixin.accessors.PackAccessor;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.network.RPackBypass;
import me.retucio.sputnik.util.interfaces.IConfirmScreen;
@@ -1,10 +1,10 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import me.retucio.sputnik.event.Stage;
import me.retucio.sputnik.event.events.DisconnectEvent;
import me.retucio.sputnik.event.events.PacketEvent;
import me.retucio.sputnik.event.events.network.DisconnectEvent;
import me.retucio.sputnik.event.events.network.PacketEvent;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.network.packet.Packet;
@@ -1,8 +1,8 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import me.retucio.sputnik.command.CommandManager;
import me.retucio.sputnik.event.events.SendMessageEvent;
import me.retucio.sputnik.event.events.network.SendMessageEvent;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.render.NoRender;
import me.retucio.sputnik.util.ChatUtil;
@@ -55,7 +55,7 @@ public abstract class ClientPlayNetworkHandlerMixin {
@Redirect(method = "onEntityStatus", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;showFloatingItem(Lnet/minecraft/item/ItemStack;)V"))
private void noRenderTotemPop(GameRenderer instance, ItemStack floatingItem) {
NoRender noRender = ModuleManager.INSTANCE.getModuleByClass(NoRender.class);
if (!noRender.isEnabled() || noRender.totemPop.isEnabled())
if (!noRender.isEnabled() || noRender.totemPop.getValue())
mc.gameRenderer.showFloatingItem(floatingItem);
}
}
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import com.mojang.authlib.GameProfile;
import me.retucio.sputnik.util.interfaces.IMessageHandler;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.network.RPackBypass;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.network.RPackBypass;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import me.retucio.sputnik.module.ModuleManager;
import me.retucio.sputnik.module.modules.network.RPackBypass;
@@ -1,4 +1,4 @@
package me.retucio.sputnik.mixin;
package me.retucio.sputnik.mixin.mixins.network;
import net.minecraft.client.session.telemetry.TelemetryManager;
import org.spongepowered.asm.mixin.Mixin;
Loaded 100 of 291 files, more files were not shown because too many files have changed in this diff. Show more