Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acecda3c0d | ||
|
|
ad0349aa29 | ||
|
|
f1eed6f957 | ||
|
|
c993d4fdac | ||
|
|
a9fd8da7f5 |
No files matched your search
+14
-5
@@ -11,20 +11,29 @@ base {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "FDD Maven"
|
||||
url = "https://maven.firstdark.dev/releases"
|
||||
}
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven {
|
||||
name = "FDD Maven"
|
||||
url = "https://maven.firstdark.dev/releases"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// mc
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_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}"
|
||||
|
||||
// otros
|
||||
// sistema de eventos
|
||||
include(modImplementation "com.github.retuci0:neutrino:${project.neutrino_version}")
|
||||
|
||||
// rpc de discord
|
||||
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
|
||||
}
|
||||
|
||||
|
||||
+6
-25
@@ -1,37 +1,18 @@
|
||||
# v3.0
|
||||
# v3.5
|
||||
|
||||
## novedades
|
||||
|
||||
- categoría de combate
|
||||
|
||||
### adiciones
|
||||
|
||||
|
||||
#### módulos nuevos:
|
||||
|
||||
- colocar en aire: te permite colocar bloques sin soporte alguno
|
||||
- tobillos fuertes: evita el daño de caída, ya sea por medio de paquetes o amortiguándola con un cubo de agua, si este está disponible
|
||||
- don quijote: te acelera para inflingir cantidades importantes de daño con la lanza
|
||||
- auto herramienta: cambia automáticamente a la herramienta más veloz disponible para el bloque seleccionado
|
||||
- autismo: da vueltas
|
||||
- anti hambre: previene el hambre, cancelando los paquetes que le indican al server que empiezas a esprintar
|
||||
- trayectoria: preve la trayectoria de los proyectiles (maomeno, aún lo tengo que ajustar un poco)
|
||||
- hotkeys inv. creativo: te permite usar las teclas de la hotbar correctamente en la pestaña de búsqueda, por ejemplo, si tienes el slot 5 en la E, al posicionar el cursor sobre un stack del resultado de búsqueda, y darle a la E, en vez de escribir una E, actúa como las teclas del 1-9
|
||||
- auto pesca: pesca por ti
|
||||
|
||||
#### comandos nuevos:
|
||||
|
||||
- `$plugins`: trata de buscar plugins del server al que estás conectado mediante la búsqueda de comandos no vanilla
|
||||
- `$clickslot`: simula un clic en un slot específico, también se especifica el botón del ratón y la acción
|
||||
- `$wait`: espera un delay determinado antes de enviar un mensaje / ejecutar un comando
|
||||
- `$repeat`: repite un comando o mensaje x veces
|
||||
|
||||
### arreglos / mejoras
|
||||
|
||||
- delfín ahora funciona mejor (*ruidos de delfín*)
|
||||
- barco volador ahora usa el ajuste de velocidad vertical
|
||||
- escalones inversos ahora usa el ajuste de velocidad
|
||||
- ahora puedes ver el tiempo restante hasta que una entidad de tnt explote
|
||||
- arreglado el crash por no incluir el sistema de eventos en el mod (soy gilipollas)
|
||||
- mejoras varias al módulo tobillos fuertes
|
||||
- ahora el módulo de interfaces en portales funciona correctamente
|
||||
- reponer ya no está repe
|
||||
|
||||
## problemas reconocidos
|
||||
|
||||
- muchos, pero repórtalos en la página de problemas si quieres para que queden bien registrados
|
||||
+3
-1
@@ -8,6 +8,8 @@ loom_version=1.13-SNAPSHOT
|
||||
|
||||
fabric_api_version=0.140.2+1.21.11
|
||||
|
||||
mod_version=3.0
|
||||
neutrino_version=1.1.0
|
||||
|
||||
mod_version=3.5
|
||||
maven_group=me.retucio
|
||||
archives_base_name=sputnik
|
||||
@@ -1,19 +1,18 @@
|
||||
package me.retucio.sputnik;
|
||||
|
||||
|
||||
import com.github.retucio.neutrino.EventBus;
|
||||
import me.retucio.sputnik.cape.CapeManager;
|
||||
import me.retucio.sputnik.command.CommandManager;
|
||||
import me.retucio.sputnik.command.commands.BindCommand;
|
||||
|
||||
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.sputnik.LoadCapeManagerEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent;
|
||||
import me.retucio.sputnik.event.ShutdownEvent;
|
||||
import me.retucio.sputnik.event.interact.OpenScreenEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadCapeManagerEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadClickGUIEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadCommandManagerEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadModuleManagerEvent;
|
||||
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
@@ -22,6 +21,7 @@ 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;
|
||||
@@ -32,7 +32,6 @@ import me.retucio.sputnik.ui.widgets.Button;
|
||||
import me.retucio.sputnik.util.*;
|
||||
import me.retucio.sputnik.util.KeyUtil;
|
||||
import me.retucio.sputnik.util.render.DrawUtil;
|
||||
import me.retucio.sputnik.util.render.Pipelines;
|
||||
import me.retucio.sputnik.util.render.RenderUtil;
|
||||
|
||||
import me.retucio.sputnik.util.render.Textures;
|
||||
@@ -43,6 +42,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;
|
||||
@@ -52,7 +52,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
|
||||
|
||||
public class Sputnik implements ClientModInitializer {
|
||||
|
||||
// cosas necesarias
|
||||
@@ -83,18 +82,19 @@ public class Sputnik implements ClientModInitializer {
|
||||
mc = MinecraftClient.getInstance();
|
||||
ConfigManager.load();
|
||||
|
||||
EVENT_BUS.register(this);
|
||||
VersionChecker.check();
|
||||
|
||||
EVENT_BUS.register(ChatUtil.class);
|
||||
EVENT_BUS.register(DrawUtil.class);
|
||||
EVENT_BUS.register(EntityUtil.class);
|
||||
EVENT_BUS.register(InventoryUtil.class);
|
||||
EVENT_BUS.register(MiscUtil.class);
|
||||
EVENT_BUS.register(NetworkUtil.class);
|
||||
EVENT_BUS.register(RenderUtil.class);
|
||||
EVENT_BUS.subscribe(this);
|
||||
|
||||
EVENT_BUS.subscribe(ChatUtil.class);
|
||||
EVENT_BUS.subscribe(DrawUtil.class);
|
||||
EVENT_BUS.subscribe(EntityUtil.class);
|
||||
EVENT_BUS.subscribe(InventoryUtil.class);
|
||||
EVENT_BUS.subscribe(MiscUtil.class);
|
||||
EVENT_BUS.subscribe(NetworkUtil.class);
|
||||
EVENT_BUS.subscribe(RenderUtil.class);
|
||||
|
||||
Lists.init();
|
||||
|
||||
Textures.init();
|
||||
|
||||
CapeManager.INSTANCE = new CapeManager();
|
||||
@@ -132,8 +132,8 @@ public class Sputnik implements ClientModInitializer {
|
||||
|
||||
|
||||
// se ejecuta cada vez que se presiona una tecla
|
||||
public void onKey(int key, int action) {
|
||||
if (key == GLFW.GLFW_KEY_F3) return; // prevenir activación de módulos al usar combinaciones de F3
|
||||
public void onInput(int key, int action) {
|
||||
if (key == GLFW.GLFW_KEY_F3) return; // prevenir interrumpir combos de F3
|
||||
|
||||
boolean anyFocused = isAnySettingButtonFocused() || ClickGUI.INSTANCE.getSearchBar().isFocused();
|
||||
ClickGUI.INSTANCE.setAnyFocused(anyFocused);
|
||||
@@ -145,7 +145,10 @@ public class Sputnik implements ClientModInitializer {
|
||||
handleClickGUIKey(key, anyFocused);
|
||||
handleHudEditorKey(key, anyFocused);
|
||||
}
|
||||
handleSettingButtonsKey(key, action);
|
||||
// solo reenviar teclas del teclado
|
||||
if (key >= 32) {
|
||||
handleSettingButtonsKey(key, action);
|
||||
}
|
||||
} else if (!anyFocused) {
|
||||
handleModuleRelease(key);
|
||||
}
|
||||
@@ -189,8 +192,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);
|
||||
@@ -234,7 +235,15 @@ public class Sputnik implements ClientModInitializer {
|
||||
|| 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) {
|
||||
ConfigManager.save();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package me.retucio.sputnik.command;
|
||||
|
||||
import com.github.retucio.neutrino.EventListener;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.command.commands.*;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
@@ -52,8 +52,8 @@ public class CommandManager {
|
||||
|
||||
for (Command command : commands) {
|
||||
for (Method method : command.getClass().getDeclaredMethods()) {
|
||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
||||
Sputnik.EVENT_BUS.register(command);
|
||||
if (method.isAnnotationPresent(EventListener.class)) {
|
||||
Sputnik.EVENT_BUS.subscribe(command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,20 @@ import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.ModuleArgumentType;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
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.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.text.Text;
|
||||
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
|
||||
public class BindCommand extends Command {
|
||||
|
||||
@@ -42,6 +50,24 @@ public class BindCommand extends Command {
|
||||
public static boolean onKeyPress(int key) {
|
||||
if (listeningModule == null) return false;
|
||||
KeySetting bind = listeningModule.getBind();
|
||||
|
||||
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(
|
||||
|
||||
@@ -2,8 +2,7 @@ package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.TickEvent;
|
||||
import me.retucio.sputnik.event.TickEvent;
|
||||
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.InventoryUtil;
|
||||
@@ -35,7 +34,6 @@ public class EnderChestCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(TickEvent.Post event) {
|
||||
if (shouldOpenEchest) {
|
||||
shouldOpenEchest = false;
|
||||
|
||||
@@ -6,8 +6,7 @@ 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.event.network.PacketEvent;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
|
||||
import net.minecraft.client.network.ClientCommandSource;
|
||||
@@ -90,7 +89,6 @@ public class PluginsCommand extends Command {
|
||||
node.getChildren().forEach(this::checkNodeForPlugins);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
private void onPacketReceive(PacketEvent.Receive event) {
|
||||
if (!scanning) return;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -3,8 +3,7 @@ package me.retucio.sputnik.command.commands;
|
||||
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.input.KeyEvent;
|
||||
import me.retucio.sputnik.event.input.KeyEvent;
|
||||
import me.retucio.sputnik.util.EntityUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -38,7 +37,6 @@ public class SpectateCommand extends Command {
|
||||
);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKey(KeyEvent event) {
|
||||
if (mc.getCameraEntity() != mc.player && mc.currentScreen == null
|
||||
&& event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package me.retucio.sputnik.config;
|
||||
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.*;
|
||||
import me.retucio.sputnik.event.sputnik.*;
|
||||
import me.retucio.sputnik.module.setting.settings.*;
|
||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||
|
||||
@@ -38,19 +37,17 @@ public class ClientConfig {
|
||||
public Map<String, String> hudImagePaths = new HashMap<>();
|
||||
|
||||
// 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() {
|
||||
EVENT_BUS.register(this);
|
||||
EVENT_BUS.subscribe(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onToggleModule(ToggleModuleEvent event) {
|
||||
ConfigManager.setModuleState(event.getModule());
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SubscribeEvent
|
||||
public void onUpdateSetting(UpdateSettingEvent event) {
|
||||
if (mc == null || !event.shouldSave()) return;
|
||||
|
||||
@@ -71,24 +68,20 @@ public class ClientConfig {
|
||||
ConfigManager.setSetting(event.getSetting(), value);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
|
||||
ConfigManager.setFramePosition(event.getFrame());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
|
||||
settingsFrames.remove(event.getFrame().getModule().getName());
|
||||
ConfigManager.save();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
|
||||
settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()});
|
||||
ConfigManager.save();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onExtendModuleFrame(ModuleFrameEvent.Extend event) {
|
||||
extendableFrames.put("M", new FrameData(
|
||||
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
||||
@@ -96,7 +89,6 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getModulesFrame().extended));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMoveModuleFrame(ModuleFrameEvent.Move event) {
|
||||
extendableFrames.replace("M", new FrameData(
|
||||
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
||||
@@ -104,7 +96,6 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getModulesFrame().extended));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) {
|
||||
extendableFrames.put("S", new FrameData(
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
||||
@@ -112,7 +103,6 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) {
|
||||
extendableFrames.replace("S", new FrameData(
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
||||
|
||||
@@ -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,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,9 +0,0 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ChunkOcclusionDataBuilderMixin#onChunkOcclusion
|
||||
*/
|
||||
public class ChunkOcclusionEvent extends Event {}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.event.events.input;
|
||||
package me.retucio.sputnik.event.input;
|
||||
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import net.minecraft.text.ClickEvent;
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events.input;
|
||||
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 {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events.input;
|
||||
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 {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events.input;
|
||||
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 {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onAttackEntity
|
||||
* @see ClientPlayerInteractionManagerMixin#onAttackEntity
|
||||
*/
|
||||
public class AttackEntityEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockBreak
|
||||
* @see ClientPlayerInteractionManagerMixin#onBlockBreak
|
||||
*/
|
||||
public class BreakBlockEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
public class ClipAtLedgeEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ItemStackMixin#onDamage
|
||||
* @see ItemStackMixin#onDamage
|
||||
*/
|
||||
public class DamageItemEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onEntityInteract
|
||||
* @see ClientPlayerInteractionManagerMixin#onEntityInteract
|
||||
*/
|
||||
public class InteractEntityEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onOpenScreen
|
||||
* @see MinecraftClientMixin#onOpenScreen
|
||||
*/
|
||||
public class OpenScreenEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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.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.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;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.interact;
|
||||
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.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onUseItem
|
||||
* @see MinecraftClientMixin#onUseItem
|
||||
*/
|
||||
public class UseItemEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onAddEntity
|
||||
* @see ClientWorldMixin#onAddEntity
|
||||
*/
|
||||
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 {}
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
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.network.DisconnectionInfo;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onDisconnect
|
||||
* @see ClientConnectionMixin#onDisconnect
|
||||
*/
|
||||
public class DisconnectEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onJoinWorld
|
||||
* @see MinecraftClientMixin#onJoinWorld
|
||||
*/
|
||||
public class JoinWorldEvent extends Event {
|
||||
|
||||
+7
-12
@@ -1,34 +1,29 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import me.retucio.sputnik.event.Stage;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
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 {
|
||||
|
||||
public static class Send extends Event {
|
||||
|
||||
private final Packet<?> packet;
|
||||
private final Stage stage;
|
||||
|
||||
public Send(Packet<?> packet, Stage stage) {
|
||||
this.packet = packet;
|
||||
this.stage = stage;
|
||||
this.setStage(stage);
|
||||
}
|
||||
|
||||
public Packet<?> getPacket() {
|
||||
return packet;
|
||||
}
|
||||
|
||||
public Stage getStage() {
|
||||
return stage;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Receive extends Event {
|
||||
+8
-5
@@ -1,17 +1,18 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
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.text.Text;
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ChatHudMixin#onAddMessage
|
||||
* @see ChatHudMixin#onAddMessage
|
||||
*/
|
||||
public class ReceiveMessageEvent extends Event {
|
||||
|
||||
private Text text;
|
||||
private MessageIndicator indicator;
|
||||
private int id;
|
||||
private final int id;
|
||||
private boolean modified = false;
|
||||
|
||||
public ReceiveMessageEvent(Text text, MessageIndicator indicator, int id) {
|
||||
@@ -42,5 +43,7 @@ public class ReceiveMessageEvent extends Event {
|
||||
return modified;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onRemoveEntity
|
||||
* @see ClientWorldMixin#onRemoveEntity
|
||||
*/
|
||||
public class RemoveEntityEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events.network;
|
||||
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 {
|
||||
|
||||
+6
-5
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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 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 {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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 {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.GameOptionsMixin#changePerspective
|
||||
* @see GameOptionsMixin#changePerspective
|
||||
*/
|
||||
public class PerspectiveChangeEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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.render.RenderTickCounter;
|
||||
|
||||
+8
-3
@@ -1,13 +1,14 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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.RenderTickCounter;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render
|
||||
* @see WorldRendererMixin#render
|
||||
*/
|
||||
public class Render3DEvent extends Event {
|
||||
|
||||
@@ -32,4 +33,8 @@ public class Render3DEvent extends Event {
|
||||
public Camera getCamera() {
|
||||
return camera;
|
||||
}
|
||||
|
||||
public float getTickDelta() {
|
||||
return tc.getDynamicDeltaTicks();
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderArm
|
||||
* @see HeldItemRendererMixin#onRenderArm
|
||||
*/
|
||||
public class RenderArmEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
public class RenderBlockOutlineEvent extends Event {
|
||||
|
||||
+6
-5
@@ -1,6 +1,7 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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.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 {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events.render;
|
||||
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.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderItem
|
||||
* @see HeldItemRendererMixin#onRenderItem
|
||||
*/
|
||||
public class RenderHeldItemEvent extends Event {
|
||||
|
||||
+2
-2
@@ -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
|
||||
public class GUISettingsFrameEvent {
|
||||
+2
-2
@@ -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
|
||||
public class LoadCapeManagerEvent extends Event {}
|
||||
+2
-2
@@ -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
|
||||
public class LoadClickGUIEvent extends Event {}
|
||||
+2
-2
@@ -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
|
||||
public class LoadCommandManagerEvent extends Event {}
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
+2
-2
@@ -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
|
||||
public class LoadModuleManagerEvent extends Event {}
|
||||
+2
-2
@@ -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
|
||||
public class ModuleFrameEvent {
|
||||
+2
-2
@@ -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;
|
||||
|
||||
// se genera cada que se interactúa con un marco de ajustes de un módulo
|
||||
+2
-2
@@ -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;
|
||||
|
||||
// se genera cada que se enciende o apaga un módulo
|
||||
+2
-2
@@ -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.setting.Setting;
|
||||
|
||||
// se genera cada que se cambia el valor de un ajuste
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+1
-1
@@ -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
-1
@@ -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
-1
@@ -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
-1
@@ -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;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.entity.projectile.FishingBobberEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+1
-1
@@ -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
-1
@@ -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
-1
@@ -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
-1
@@ -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
-1
@@ -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;
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.event.events.interact.BoatMoveEvent;
|
||||
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;
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import me.retucio.sputnik.event.events.render.ChangeRotationEvent;
|
||||
import me.retucio.sputnik.event.render.ChangeRotationEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
import me.retucio.sputnik.module.modules.camera.Freelook;
|
||||
@@ -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
-1
@@ -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;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.movement.ElytraBounce;
|
||||
+2
-2
@@ -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.render.RenderBossbarEvent;
|
||||
import me.retucio.sputnik.event.render.RenderBossbarEvent;
|
||||
import net.minecraft.client.gui.hud.BossBarHud;
|
||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||
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
-1
@@ -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
-1
@@ -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;
|
||||
+2
-2
@@ -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.network.ReceiveMessageEvent;
|
||||
import me.retucio.sputnik.event.network.ReceiveMessageEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHud;
|
||||
+2
-2
@@ -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.render.Render2DEvent;
|
||||
import me.retucio.sputnik.event.render.Render2DEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
+1
-1
@@ -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;
|
||||
+3
-3
@@ -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.input.KeyEvent;
|
||||
import me.retucio.sputnik.event.input.KeyEvent;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.input.KeyInput;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -17,7 +17,7 @@ public abstract class KeyboardMixin {
|
||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||
private void onKeyPress(long window, int action, KeyInput input, CallbackInfo ci) {
|
||||
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));
|
||||
if (event.isCancelled()) ci.cancel();
|
||||
}
|
||||
+5
-3
@@ -1,7 +1,8 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.io;
|
||||
|
||||
import me.retucio.sputnik.event.events.input.MouseClickEvent;
|
||||
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.event.input.MouseClickEvent;
|
||||
import me.retucio.sputnik.event.input.MouseScrollEvent;
|
||||
import net.minecraft.client.Mouse;
|
||||
import net.minecraft.client.input.MouseInput;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -16,6 +17,7 @@ public abstract class MouseMixin {
|
||||
|
||||
@Inject(method = "onMouseButton", at = @At("HEAD"), cancellable = true)
|
||||
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()));
|
||||
if (event.isCancelled()) ci.cancel();
|
||||
}
|
||||
+1
-1
@@ -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;
|
||||
+2
-2
@@ -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.modules.misc.ShulkerPeek;
|
||||
import me.retucio.sputnik.module.modules.inventory.ShulkerPeek;
|
||||
import net.minecraft.block.ShulkerBoxBlock;
|
||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||
import net.minecraft.item.BlockItem;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.item;
|
||||
|
||||
import me.retucio.sputnik.event.events.interact.DamageItemEvent;
|
||||
import me.retucio.sputnik.event.interact.DamageItemEvent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
+1
-5
@@ -1,16 +1,12 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
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.Item;
|
||||
import net.minecraft.item.TridentItem;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
@Mixin(TridentItem.class)
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.misc;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.misc;
|
||||
|
||||
import me.retucio.sputnik.event.events.render.PerspectiveChangeEvent;
|
||||
import me.retucio.sputnik.event.render.PerspectiveChangeEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
import net.minecraft.client.option.GameOptions;
|
||||
+11
-7
@@ -1,12 +1,12 @@
|
||||
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.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.interact.UseItemEvent;
|
||||
import me.retucio.sputnik.event.network.JoinWorldEvent;
|
||||
import me.retucio.sputnik.event.interact.OpenScreenEvent;
|
||||
import me.retucio.sputnik.event.ShutdownEvent;
|
||||
import me.retucio.sputnik.event.TickEvent;
|
||||
import me.retucio.sputnik.event.interact.UseItemEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.player.FastUse;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -14,6 +14,7 @@ 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.*;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@@ -32,6 +33,10 @@ public abstract class MinecraftClientMixin {
|
||||
|
||||
// eventos
|
||||
|
||||
@Shadow
|
||||
@Nullable
|
||||
public Screen currentScreen;
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"))
|
||||
private void onTickPre(CallbackInfo ci) {
|
||||
Sputnik.INSTANCE.onTick();
|
||||
@@ -67,7 +72,6 @@ public abstract class MinecraftClientMixin {
|
||||
if (event.isCancelled()) ci.cancel();
|
||||
}
|
||||
|
||||
|
||||
// telemetría
|
||||
|
||||
@Inject(method = "isTelemetryEnabledByApi", at = @At("RETURN"), cancellable = true)
|
||||
+1
-1
@@ -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;
|
||||
+1
-1
@@ -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
-1
@@ -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;
|
||||
+3
-3
@@ -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;
|
||||
Loaded 100 of 233 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user