v3.3
This commit is contained in:
1 parent
c993d4fdac
commit
f1eed6f957
151 files changed
+736
-570
No files matched your search
+14
-5
@@ -11,20 +11,29 @@ base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
mavenCentral()
|
||||||
name = "FDD Maven"
|
maven { url 'https://jitpack.io' }
|
||||||
url = "https://maven.firstdark.dev/releases"
|
maven {
|
||||||
}
|
name = "FDD Maven"
|
||||||
|
url = "https://maven.firstdark.dev/releases"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// mc
|
// mc
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||||
|
|
||||||
|
// mappings
|
||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||||
|
|
||||||
|
// fabric & su api
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
||||||
|
|
||||||
// otros
|
// sistema de eventos
|
||||||
|
modImplementation "com.github.retuci0:neutrino:${project.neutrino_version}"
|
||||||
|
|
||||||
|
// rpc de discord
|
||||||
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
|
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-4
@@ -1,18 +1,22 @@
|
|||||||
# v3.2
|
# v3.3
|
||||||
|
|
||||||
## novedades
|
## novedades
|
||||||
|
|
||||||
|
- cambiado de sistema de eventos
|
||||||
|
- categoría de inventario
|
||||||
|
|
||||||
### adiciones
|
### adiciones
|
||||||
|
|
||||||
#### módulos nuevos:
|
#### módulos nuevos:
|
||||||
|
|
||||||
- dupe de bundle: robado de .gg/dupes, usando un bundle y un libro de bookbot, dupea 63 del ítem deseado
|
- reponer: repone items a medida que se usan de forma automática
|
||||||
- j. k. rowling: rellena libros con caca de manera automática
|
|
||||||
|
|
||||||
### arreglos / mejoras
|
### arreglos / mejoras
|
||||||
|
|
||||||
- ahora el aviso de actualizaciones ya funciona bien
|
- ahora el grosor de línea de hitboxes funciona
|
||||||
|
- ahora cabezas de chatplus funciona, a medias
|
||||||
|
|
||||||
## problemas reconocidos
|
## problemas reconocidos
|
||||||
|
|
||||||
|
- es posible que algunos módulos hayan dejado de funcionar correctamente, ya que he cambiado de sistema de eventos
|
||||||
- muchos, pero repórtalos en la página de problemas si quieres para que queden bien registrados
|
- 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
|
fabric_api_version=0.140.2+1.21.11
|
||||||
|
|
||||||
mod_version=3.1
|
neutrino_version=1.1.0
|
||||||
|
|
||||||
|
mod_version=3.3
|
||||||
maven_group=me.retucio
|
maven_group=me.retucio
|
||||||
archives_base_name=sputnik
|
archives_base_name=sputnik
|
||||||
@@ -1,20 +1,18 @@
|
|||||||
package me.retucio.sputnik;
|
package me.retucio.sputnik;
|
||||||
|
|
||||||
import com.ibm.icu.text.CaseMap;
|
import com.github.retucio.neutrino.EventBus;
|
||||||
import me.retucio.sputnik.cape.CapeManager;
|
import me.retucio.sputnik.cape.CapeManager;
|
||||||
import me.retucio.sputnik.command.CommandManager;
|
import me.retucio.sputnik.command.CommandManager;
|
||||||
import me.retucio.sputnik.command.commands.BindCommand;
|
import me.retucio.sputnik.command.commands.BindCommand;
|
||||||
|
|
||||||
import me.retucio.sputnik.config.ConfigManager;
|
import me.retucio.sputnik.config.ConfigManager;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.EventBus;
|
import me.retucio.sputnik.event.ShutdownEvent;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.interact.OpenScreenEvent;
|
||||||
import me.retucio.sputnik.event.events.ShutdownEvent;
|
import me.retucio.sputnik.event.sputnik.LoadCapeManagerEvent;
|
||||||
import me.retucio.sputnik.event.events.interact.OpenScreenEvent;
|
import me.retucio.sputnik.event.sputnik.LoadClickGUIEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.LoadCapeManagerEvent;
|
import me.retucio.sputnik.event.sputnik.LoadCommandManagerEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent;
|
import me.retucio.sputnik.event.sputnik.LoadModuleManagerEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent;
|
|
||||||
import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent;
|
|
||||||
|
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
@@ -53,14 +51,6 @@ import org.apache.logging.log4j.Logger;
|
|||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
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 {
|
public class Sputnik implements ClientModInitializer {
|
||||||
|
|
||||||
@@ -94,15 +84,15 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
|
|
||||||
VersionChecker.check();
|
VersionChecker.check();
|
||||||
|
|
||||||
EVENT_BUS.register(this);
|
EVENT_BUS.subscribe(this);
|
||||||
|
|
||||||
EVENT_BUS.register(ChatUtil.class);
|
EVENT_BUS.subscribe(ChatUtil.class);
|
||||||
EVENT_BUS.register(DrawUtil.class);
|
EVENT_BUS.subscribe(DrawUtil.class);
|
||||||
EVENT_BUS.register(EntityUtil.class);
|
EVENT_BUS.subscribe(EntityUtil.class);
|
||||||
EVENT_BUS.register(InventoryUtil.class);
|
EVENT_BUS.subscribe(InventoryUtil.class);
|
||||||
EVENT_BUS.register(MiscUtil.class);
|
EVENT_BUS.subscribe(MiscUtil.class);
|
||||||
EVENT_BUS.register(NetworkUtil.class);
|
EVENT_BUS.subscribe(NetworkUtil.class);
|
||||||
EVENT_BUS.register(RenderUtil.class);
|
EVENT_BUS.subscribe(RenderUtil.class);
|
||||||
|
|
||||||
Lists.init();
|
Lists.init();
|
||||||
Textures.init();
|
Textures.init();
|
||||||
@@ -243,7 +233,6 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// notificar al usuario de que hay una actualización disponible, si la hay
|
// notificar al usuario de que hay una actualización disponible, si la hay
|
||||||
@SubscribeEvent
|
|
||||||
public void onSetScreen(OpenScreenEvent event) {
|
public void onSetScreen(OpenScreenEvent event) {
|
||||||
if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) {
|
if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) {
|
||||||
event.cancel();
|
event.cancel();
|
||||||
@@ -252,7 +241,6 @@ public class Sputnik implements ClientModInitializer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onStop(ShutdownEvent event) {
|
public void onStop(ShutdownEvent event) {
|
||||||
ConfigManager.save();
|
ConfigManager.save();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package me.retucio.sputnik.command;
|
package me.retucio.sputnik.command;
|
||||||
|
|
||||||
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import com.mojang.brigadier.CommandDispatcher;
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.command.commands.*;
|
import me.retucio.sputnik.command.commands.*;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
|
|
||||||
@@ -52,8 +52,8 @@ public class CommandManager {
|
|||||||
|
|
||||||
for (Command command : commands) {
|
for (Command command : commands) {
|
||||||
for (Method method : command.getClass().getDeclaredMethods()) {
|
for (Method method : command.getClass().getDeclaredMethods()) {
|
||||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
if (method.isAnnotationPresent(EventListener.class)) {
|
||||||
Sputnik.EVENT_BUS.register(command);
|
Sputnik.EVENT_BUS.subscribe(command);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ package me.retucio.sputnik.command.commands;
|
|||||||
|
|
||||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
import me.retucio.sputnik.command.Command;
|
import me.retucio.sputnik.command.Command;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.TickEvent;
|
||||||
import me.retucio.sputnik.event.events.TickEvent;
|
|
||||||
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
import me.retucio.sputnik.util.InventoryUtil;
|
import me.retucio.sputnik.util.InventoryUtil;
|
||||||
@@ -35,7 +34,6 @@ public class EnderChestCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onTick(TickEvent.Post event) {
|
public void onTick(TickEvent.Post event) {
|
||||||
if (shouldOpenEchest) {
|
if (shouldOpenEchest) {
|
||||||
shouldOpenEchest = false;
|
shouldOpenEchest = false;
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import com.mojang.brigadier.tree.CommandNode;
|
|||||||
import com.mojang.brigadier.tree.RootCommandNode;
|
import com.mojang.brigadier.tree.RootCommandNode;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.command.Command;
|
import me.retucio.sputnik.command.Command;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.network.PacketEvent;
|
||||||
import me.retucio.sputnik.event.events.network.PacketEvent;
|
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
|
|
||||||
import net.minecraft.client.network.ClientCommandSource;
|
import net.minecraft.client.network.ClientCommandSource;
|
||||||
@@ -90,7 +89,6 @@ public class PluginsCommand extends Command {
|
|||||||
node.getChildren().forEach(this::checkNodeForPlugins);
|
node.getChildren().forEach(this::checkNodeForPlugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
private void onPacketReceive(PacketEvent.Receive event) {
|
private void onPacketReceive(PacketEvent.Receive event) {
|
||||||
if (!scanning) return;
|
if (!scanning) return;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ package me.retucio.sputnik.command.commands;
|
|||||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
import me.retucio.sputnik.command.Command;
|
import me.retucio.sputnik.command.Command;
|
||||||
import me.retucio.sputnik.command.args.EntityArgumentType;
|
import me.retucio.sputnik.command.args.EntityArgumentType;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.input.KeyEvent;
|
||||||
import me.retucio.sputnik.event.events.input.KeyEvent;
|
|
||||||
import me.retucio.sputnik.util.EntityUtil;
|
import me.retucio.sputnik.util.EntityUtil;
|
||||||
import net.minecraft.command.CommandSource;
|
import net.minecraft.command.CommandSource;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@@ -38,7 +37,6 @@ public class SpectateCommand extends Command {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onKey(KeyEvent event) {
|
public void onKey(KeyEvent event) {
|
||||||
if (mc.getCameraEntity() != mc.player && mc.currentScreen == null
|
if (mc.getCameraEntity() != mc.player && mc.currentScreen == null
|
||||||
&& event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) {
|
&& event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package me.retucio.sputnik.config;
|
package me.retucio.sputnik.config;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.sputnik.*;
|
||||||
import me.retucio.sputnik.event.events.sputnik.*;
|
|
||||||
import me.retucio.sputnik.module.setting.settings.*;
|
import me.retucio.sputnik.module.setting.settings.*;
|
||||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||||
|
|
||||||
@@ -38,19 +37,17 @@ public class ClientConfig {
|
|||||||
public Map<String, String> hudImagePaths = new HashMap<>();
|
public Map<String, String> hudImagePaths = new HashMap<>();
|
||||||
|
|
||||||
// posición de la barra de búsqueda (x, y)
|
// posición de la barra de búsqueda (x, y)
|
||||||
public int[] searchBarPosition = new int[]{340, 16};
|
public int[] searchBarPosition = new int[] { 340, 16 };
|
||||||
|
|
||||||
public ClientConfig() {
|
public ClientConfig() {
|
||||||
EVENT_BUS.register(this);
|
EVENT_BUS.subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onToggleModule(ToggleModuleEvent event) {
|
public void onToggleModule(ToggleModuleEvent event) {
|
||||||
ConfigManager.setModuleState(event.getModule());
|
ConfigManager.setModuleState(event.getModule());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@SubscribeEvent
|
|
||||||
public void onUpdateSetting(UpdateSettingEvent event) {
|
public void onUpdateSetting(UpdateSettingEvent event) {
|
||||||
if (mc == null || !event.shouldSave()) return;
|
if (mc == null || !event.shouldSave()) return;
|
||||||
|
|
||||||
@@ -71,24 +68,20 @@ public class ClientConfig {
|
|||||||
ConfigManager.setSetting(event.getSetting(), value);
|
ConfigManager.setSetting(event.getSetting(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
|
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
|
||||||
ConfigManager.setFramePosition(event.getFrame());
|
ConfigManager.setFramePosition(event.getFrame());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
|
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
|
||||||
settingsFrames.remove(event.getFrame().getModule().getName());
|
settingsFrames.remove(event.getFrame().getModule().getName());
|
||||||
ConfigManager.save();
|
ConfigManager.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
|
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
|
||||||
settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()});
|
settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()});
|
||||||
ConfigManager.save();
|
ConfigManager.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onExtendModuleFrame(ModuleFrameEvent.Extend event) {
|
public void onExtendModuleFrame(ModuleFrameEvent.Extend event) {
|
||||||
extendableFrames.put("M", new FrameData(
|
extendableFrames.put("M", new FrameData(
|
||||||
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
||||||
@@ -96,7 +89,6 @@ public class ClientConfig {
|
|||||||
ClickGUI.INSTANCE.getModulesFrame().extended));
|
ClickGUI.INSTANCE.getModulesFrame().extended));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onMoveModuleFrame(ModuleFrameEvent.Move event) {
|
public void onMoveModuleFrame(ModuleFrameEvent.Move event) {
|
||||||
extendableFrames.replace("M", new FrameData(
|
extendableFrames.replace("M", new FrameData(
|
||||||
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
||||||
@@ -104,7 +96,6 @@ public class ClientConfig {
|
|||||||
ClickGUI.INSTANCE.getModulesFrame().extended));
|
ClickGUI.INSTANCE.getModulesFrame().extended));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) {
|
public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) {
|
||||||
extendableFrames.put("S", new FrameData(
|
extendableFrames.put("S", new FrameData(
|
||||||
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
||||||
@@ -112,7 +103,6 @@ public class ClientConfig {
|
|||||||
ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
|
ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) {
|
public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) {
|
||||||
extendableFrames.replace("S", new FrameData(
|
extendableFrames.replace("S", new FrameData(
|
||||||
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package me.retucio.sputnik.event.events;
|
package me.retucio.sputnik.event;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.Event;
|
import com.github.retucio.neutrino.Event;
|
||||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||||
|
|
||||||
|
|
||||||
@@ -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 {}
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package me.retucio.sputnik.event.events;
|
package me.retucio.sputnik.event;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.Event;
|
import com.github.retucio.neutrino.Event;
|
||||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||||
|
|
||||||
|
|
||||||
+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 me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
import net.minecraft.text.ClickEvent;
|
import net.minecraft.text.ClickEvent;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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;
|
import me.retucio.sputnik.mixin.mixins.io.KeyboardMixin;
|
||||||
|
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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;
|
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
|
||||||
|
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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;
|
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
|
||||||
|
|
||||||
|
|
||||||
+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.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
+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.block.BlockState;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
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.entity.vehicle.AbstractBoatEntity;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
+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 {
|
public class ClipAtLedgeEvent 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 me.retucio.sputnik.mixin.mixins.item.ItemStackMixin;
|
import me.retucio.sputnik.mixin.mixins.item.ItemStackMixin;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
+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 me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
+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 SwitchSlotEvent extends Event {
|
public class SwitchSlotEvent 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 me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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 me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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.ChunkOcclusionDataBuilderMixin;
|
import me.retucio.sputnik.mixin.mixins.world.ChunkOcclusionDataBuilderMixin;
|
||||||
|
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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 me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
|
||||||
import net.minecraft.client.network.ServerInfo;
|
import net.minecraft.client.network.ServerInfo;
|
||||||
import net.minecraft.network.DisconnectionInfo;
|
import net.minecraft.network.DisconnectionInfo;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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 me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
|
|
||||||
+3
-9
@@ -1,7 +1,6 @@
|
|||||||
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.event.Stage;
|
|
||||||
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
|
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
|
||||||
import net.minecraft.network.packet.Packet;
|
import net.minecraft.network.packet.Packet;
|
||||||
|
|
||||||
@@ -16,20 +15,15 @@ public class PacketEvent {
|
|||||||
public static class Send extends Event {
|
public static class Send extends Event {
|
||||||
|
|
||||||
private final Packet<?> packet;
|
private final Packet<?> packet;
|
||||||
private final Stage stage;
|
|
||||||
|
|
||||||
public Send(Packet<?> packet, Stage stage) {
|
public Send(Packet<?> packet, Stage stage) {
|
||||||
this.packet = packet;
|
this.packet = packet;
|
||||||
this.stage = stage;
|
this.setStage(stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Packet<?> getPacket() {
|
public Packet<?> getPacket() {
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stage getStage() {
|
|
||||||
return stage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Receive extends Event {
|
public static class Receive extends Event {
|
||||||
+6
-4
@@ -1,6 +1,6 @@
|
|||||||
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 me.retucio.sputnik.mixin.mixins.hud.ChatHudMixin;
|
||||||
import net.minecraft.client.gui.hud.MessageIndicator;
|
import net.minecraft.client.gui.hud.MessageIndicator;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
@@ -12,7 +12,7 @@ public class ReceiveMessageEvent extends Event {
|
|||||||
|
|
||||||
private Text text;
|
private Text text;
|
||||||
private MessageIndicator indicator;
|
private MessageIndicator indicator;
|
||||||
private int id;
|
private final int id;
|
||||||
private boolean modified = false;
|
private boolean modified = false;
|
||||||
|
|
||||||
public ReceiveMessageEvent(Text text, MessageIndicator indicator, int id) {
|
public ReceiveMessageEvent(Text text, MessageIndicator indicator, int id) {
|
||||||
@@ -43,5 +43,7 @@ public class ReceiveMessageEvent extends Event {
|
|||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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 me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
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;
|
import me.retucio.sputnik.mixin.mixins.network.ClientPlayNetworkHandlerMixin;
|
||||||
|
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
|
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
|
||||||
|
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.render.GameRendererMixin;
|
import me.retucio.sputnik.mixin.mixins.render.GameRendererMixin;
|
||||||
|
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.misc.GameOptionsMixin;
|
import me.retucio.sputnik.mixin.mixins.misc.GameOptionsMixin;
|
||||||
import net.minecraft.client.option.Perspective;
|
import net.minecraft.client.option.Perspective;
|
||||||
|
|
||||||
+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.gui.DrawContext;
|
||||||
import net.minecraft.client.render.RenderTickCounter;
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
|
|
||||||
+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 me.retucio.sputnik.mixin.mixins.render.WorldRendererMixin;
|
import me.retucio.sputnik.mixin.mixins.render.WorldRendererMixin;
|
||||||
import net.minecraft.client.render.Camera;
|
import net.minecraft.client.render.Camera;
|
||||||
import net.minecraft.client.render.RenderTickCounter;
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
+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 me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
|
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
+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 {
|
public class RenderBlockOutlineEvent 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 me.retucio.sputnik.mixin.mixins.hud.BossBarHudMixin;
|
import me.retucio.sputnik.mixin.mixins.hud.BossBarHudMixin;
|
||||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
+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 me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
|
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
+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
|
// se genera cada que se interactúa con el marco de ajustes de la interfaz
|
||||||
public class GUISettingsFrameEvent {
|
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
|
// se genera cuando carga el gestor de capas
|
||||||
public class LoadCapeManagerEvent extends Event {}
|
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
|
// se genera cuando carga la interfaz del mod
|
||||||
public class LoadClickGUIEvent extends Event {}
|
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
|
// se genera cuando carga el gestor de comandos
|
||||||
public class LoadCommandManagerEvent extends Event {}
|
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 {
|
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
|
// se genera cuando carga el gestor de módulos
|
||||||
public class LoadModuleManagerEvent extends Event {}
|
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
|
// se genera cada que se interactúa con el marco de módulos
|
||||||
public class ModuleFrameEvent {
|
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;
|
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||||
|
|
||||||
// se genera cada que se interactúa con un marco de ajustes de un módulo
|
// se genera cada que se interactúa con un marco de ajustes de un módulo
|
||||||
+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;
|
import me.retucio.sputnik.module.Module;
|
||||||
|
|
||||||
// se genera cada que se enciende o apaga un módulo
|
// se genera cada que se enciende o apaga un módulo
|
||||||
+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;
|
import me.retucio.sputnik.module.setting.Setting;
|
||||||
|
|
||||||
// se genera cada que se cambia el valor de un ajuste
|
// se genera cada que se cambia el valor de un ajuste
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.entity;
|
package me.retucio.sputnik.mixin.mixins.entity;
|
||||||
|
|
||||||
import me.retucio.sputnik.Sputnik;
|
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.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.movement.BoatFly;
|
import me.retucio.sputnik.module.modules.movement.BoatFly;
|
||||||
import net.minecraft.entity.MovementType;
|
import net.minecraft.entity.MovementType;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.entity;
|
package me.retucio.sputnik.mixin.mixins.entity;
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
import me.retucio.sputnik.event.events.render.ChangeRotationEvent;
|
import me.retucio.sputnik.event.render.ChangeRotationEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freelook;
|
import me.retucio.sputnik.module.modules.camera.Freelook;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin.mixins.hud;
|
|||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.sputnik.event.events.render.RenderBossbarEvent;
|
import me.retucio.sputnik.event.render.RenderBossbarEvent;
|
||||||
import net.minecraft.client.gui.hud.BossBarHud;
|
import net.minecraft.client.gui.hud.BossBarHud;
|
||||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package me.retucio.sputnik.mixin.mixins.hud;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReceiver;
|
||||||
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
|
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
|
import net.minecraft.client.font.Alignment;
|
||||||
|
import net.minecraft.client.font.DrawnTextConsumer;
|
||||||
|
import net.minecraft.client.font.TextRenderer;
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
|
import net.minecraft.client.gui.hud.ChatHud;
|
||||||
|
import net.minecraft.text.OrderedText;
|
||||||
|
import net.minecraft.util.math.ColorHelper;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(ChatHud.Interactable.class)
|
||||||
|
public abstract class ChatHudInteractableMixin {
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static ChatPlus chatPlus;
|
||||||
|
|
||||||
|
@Shadow @Final
|
||||||
|
private DrawContext context;
|
||||||
|
|
||||||
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
|
private void getModules(DrawContext context, TextRenderer textRenderer, int mouseX, int mouseY, boolean bl, CallbackInfo ci) {
|
||||||
|
chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyReceiver(method = "text", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/DrawnTextConsumer;text(Lnet/minecraft/client/font/Alignment;IILnet/minecraft/client/font/DrawnTextConsumer$Transformation;Lnet/minecraft/text/OrderedText;)V"))
|
||||||
|
private DrawnTextConsumer onRender_beforeDrawTextWithShadow(DrawnTextConsumer instance, Alignment alignment, int x, int y, DrawnTextConsumer.Transformation transformation, OrderedText orderedText) {
|
||||||
|
chatPlus.beforeDrawMessage(context, y, ColorHelper.getWhite(transformation.opacity()));
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ModifyArg(method = "text", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/DrawnTextConsumer;text(Lnet/minecraft/client/font/Alignment;IILnet/minecraft/client/font/DrawnTextConsumer$Transformation;Lnet/minecraft/text/OrderedText;)V"), index = 1)
|
||||||
|
private int modifyX(int x) {
|
||||||
|
return (chatPlus.isEnabled() && chatPlus.showHeads.getValue()) ? x + 10 : x;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "text", at = @At("TAIL"))
|
||||||
|
private void onRender_afterDrawTextWithShadow(int y, float f, OrderedText text, CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
chatPlus.afterDrawMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package me.retucio.sputnik.mixin.mixins.hud;
|
||||||
|
|
||||||
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
|
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
|
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(targets = "net.minecraft.client.gui.hud.ChatHud$1", remap = false)
|
||||||
|
public abstract class ChatHudLineConsumerMixin {
|
||||||
|
|
||||||
|
@Inject(method = "accept", at = @At("HEAD"))
|
||||||
|
private void setLine(ChatHudLine.Visible line, int y, float opacity, CallbackInfo ci) {
|
||||||
|
ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class).line = line;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin.mixins.hud;
|
|||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.sputnik.event.events.network.ReceiveMessageEvent;
|
import me.retucio.sputnik.event.network.ReceiveMessageEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
import me.retucio.sputnik.util.interfaces.IChatHud;
|
import me.retucio.sputnik.util.interfaces.IChatHud;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin.mixins.hud;
|
|||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.render.Render2DEvent;
|
import me.retucio.sputnik.event.render.Render2DEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.io;
|
package me.retucio.sputnik.mixin.mixins.io;
|
||||||
|
|
||||||
import me.retucio.sputnik.Sputnik;
|
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.Keyboard;
|
||||||
import net.minecraft.client.input.KeyInput;
|
import net.minecraft.client.input.KeyInput;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.io;
|
package me.retucio.sputnik.mixin.mixins.io;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.events.input.MouseClickEvent;
|
import me.retucio.sputnik.event.input.MouseClickEvent;
|
||||||
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
|
import me.retucio.sputnik.event.input.MouseScrollEvent;
|
||||||
import net.minecraft.client.Mouse;
|
import net.minecraft.client.Mouse;
|
||||||
import net.minecraft.client.input.MouseInput;
|
import net.minecraft.client.input.MouseInput;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.item;
|
package me.retucio.sputnik.mixin.mixins.item;
|
||||||
|
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.ShulkerPeek;
|
import me.retucio.sputnik.module.modules.inventory.ShulkerPeek;
|
||||||
import net.minecraft.block.ShulkerBoxBlock;
|
import net.minecraft.block.ShulkerBoxBlock;
|
||||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.item;
|
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.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.misc;
|
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.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
import net.minecraft.client.option.GameOptions;
|
import net.minecraft.client.option.GameOptions;
|
||||||
|
|||||||
@@ -2,15 +2,13 @@ package me.retucio.sputnik.mixin.mixins.misc;
|
|||||||
|
|
||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.network.JoinWorldEvent;
|
import me.retucio.sputnik.event.network.JoinWorldEvent;
|
||||||
import me.retucio.sputnik.event.events.interact.OpenScreenEvent;
|
import me.retucio.sputnik.event.interact.OpenScreenEvent;
|
||||||
import me.retucio.sputnik.event.events.ShutdownEvent;
|
import me.retucio.sputnik.event.ShutdownEvent;
|
||||||
import me.retucio.sputnik.event.events.TickEvent;
|
import me.retucio.sputnik.event.TickEvent;
|
||||||
import me.retucio.sputnik.event.events.interact.UseItemEvent;
|
import me.retucio.sputnik.event.interact.UseItemEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.player.FastUse;
|
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.MinecraftClient;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.network;
|
package me.retucio.sputnik.mixin.mixins.network;
|
||||||
|
|
||||||
|
import com.github.retucio.neutrino.Event;
|
||||||
import io.netty.channel.ChannelFutureListener;
|
import io.netty.channel.ChannelFutureListener;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import me.retucio.sputnik.event.Stage;
|
import me.retucio.sputnik.event.network.DisconnectEvent;
|
||||||
import me.retucio.sputnik.event.events.network.DisconnectEvent;
|
import me.retucio.sputnik.event.network.PacketEvent;
|
||||||
import me.retucio.sputnik.event.events.network.PacketEvent;
|
|
||||||
import net.minecraft.network.ClientConnection;
|
import net.minecraft.network.ClientConnection;
|
||||||
import net.minecraft.network.DisconnectionInfo;
|
import net.minecraft.network.DisconnectionInfo;
|
||||||
import net.minecraft.network.packet.Packet;
|
import net.minecraft.network.packet.Packet;
|
||||||
@@ -23,13 +23,13 @@ public abstract class ClientConnectionMixin {
|
|||||||
|
|
||||||
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;Lio/netty/channel/ChannelFutureListener;)V", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;Lio/netty/channel/ChannelFutureListener;)V", at = @At("HEAD"), cancellable = true)
|
||||||
private void onSendPacketPre(Packet<?> packet, ChannelFutureListener channelFutureListener, CallbackInfo ci) {
|
private void onSendPacketPre(Packet<?> packet, ChannelFutureListener channelFutureListener, CallbackInfo ci) {
|
||||||
PacketEvent.Send event = EVENT_BUS.post(new PacketEvent.Send(packet, Stage.PRE));
|
PacketEvent.Send event = EVENT_BUS.post(new PacketEvent.Send(packet, Event.Stage.PRE));
|
||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;Lio/netty/channel/ChannelFutureListener;)V", at = @At("TAIL"), cancellable = true)
|
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;Lio/netty/channel/ChannelFutureListener;)V", at = @At("TAIL"), cancellable = true)
|
||||||
private void onSendPacketPost(Packet<?> packet, ChannelFutureListener channelFutureListener, CallbackInfo ci) {
|
private void onSendPacketPost(Packet<?> packet, ChannelFutureListener channelFutureListener, CallbackInfo ci) {
|
||||||
PacketEvent.Send event = EVENT_BUS.post(new PacketEvent.Send(packet, Stage.POST));
|
PacketEvent.Send event = EVENT_BUS.post(new PacketEvent.Send(packet, Event.Stage.POST));
|
||||||
if (event.isCancelled()) ci.cancel();
|
if (event.isCancelled()) ci.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin.mixins.network;
|
|||||||
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import me.retucio.sputnik.command.CommandManager;
|
import me.retucio.sputnik.command.CommandManager;
|
||||||
import me.retucio.sputnik.event.events.network.SendMessageEvent;
|
import me.retucio.sputnik.event.network.SendMessageEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.render.NoRender;
|
import me.retucio.sputnik.module.modules.render.NoRender;
|
||||||
import me.retucio.sputnik.util.ChatUtil;
|
import me.retucio.sputnik.util.ChatUtil;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
|||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.world.NoMiningInterruptions;
|
import me.retucio.sputnik.module.modules.world.NoMiningInterruptions;
|
||||||
import me.retucio.sputnik.module.modules.player.PortalGUI;
|
import me.retucio.sputnik.module.modules.inventory.PortalGUI;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.network.ClientPlayerEntity;
|
import net.minecraft.client.network.ClientPlayerEntity;
|
||||||
import net.minecraft.util.hit.EntityHitResult;
|
import net.minecraft.util.hit.EntityHitResult;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.player;
|
package me.retucio.sputnik.mixin.mixins.player;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.events.interact.*;
|
import me.retucio.sputnik.event.interact.*;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
import me.retucio.sputnik.module.modules.player.FastUse;
|
import me.retucio.sputnik.module.modules.player.FastUse;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package me.retucio.sputnik.mixin.mixins.player;
|
|||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.interact.ClipAtLedgeEvent;
|
import me.retucio.sputnik.event.interact.ClipAtLedgeEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.render.Nametags;
|
import me.retucio.sputnik.module.modules.render.Nametags;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.player;
|
package me.retucio.sputnik.mixin.mixins.player;
|
||||||
|
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.interact.SwitchSlotEvent;
|
import me.retucio.sputnik.event.interact.SwitchSlotEvent;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|||||||
+9
@@ -2,9 +2,11 @@ package me.retucio.sputnik.mixin.mixins.render;
|
|||||||
|
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.render.Hitboxes;
|
import me.retucio.sputnik.module.modules.render.Hitboxes;
|
||||||
|
import net.minecraft.client.render.DrawStyle;
|
||||||
import net.minecraft.client.render.debug.EntityHitboxDebugRenderer;
|
import net.minecraft.client.render.debug.EntityHitboxDebugRenderer;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
|
|
||||||
@Mixin(EntityHitboxDebugRenderer.class)
|
@Mixin(EntityHitboxDebugRenderer.class)
|
||||||
@@ -16,4 +18,11 @@ public abstract class EntityHitboxDebugRendererMixin {
|
|||||||
if (hitboxes.isEnabled()) return hitboxes.color.getRGB();
|
if (hitboxes.isEnabled()) return hitboxes.color.getRGB();
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyArg(method = "drawHitbox", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/debug/gizmo/GizmoDrawing;box(Lnet/minecraft/util/math/Box;Lnet/minecraft/client/render/DrawStyle;)Lnet/minecraft/world/debug/gizmo/VisibilityConfigurable;"))
|
||||||
|
private DrawStyle modifyHitboxLineWidth(DrawStyle original) {
|
||||||
|
Hitboxes hitboxes = ModuleManager.INSTANCE.getModuleByClass(Hitboxes.class);
|
||||||
|
if (hitboxes.isEnabled()) return DrawStyle.stroked(original.stroke(), hitboxes.lineWidth.getFloatValue());
|
||||||
|
return original;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.render;
|
package me.retucio.sputnik.mixin.mixins.render;
|
||||||
|
|
||||||
|
|
||||||
import me.retucio.sputnik.event.events.render.GetFOVEvent;
|
import me.retucio.sputnik.event.render.GetFOVEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
import me.retucio.sputnik.module.modules.misc.UnfocusedCpu;
|
import me.retucio.sputnik.module.modules.misc.UnfocusedCpu;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.render;
|
package me.retucio.sputnik.mixin.mixins.render;
|
||||||
|
|
||||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
import me.retucio.sputnik.event.events.render.RenderHeldItemEvent;
|
import me.retucio.sputnik.event.render.RenderHeldItemEvent;
|
||||||
import me.retucio.sputnik.event.events.render.RenderArmEvent;
|
import me.retucio.sputnik.event.render.RenderArmEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.player.HandView;
|
import me.retucio.sputnik.module.modules.player.HandView;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package me.retucio.sputnik.mixin.mixins.render;
|
|||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import com.mojang.blaze3d.buffers.GpuBufferSlice;
|
import com.mojang.blaze3d.buffers.GpuBufferSlice;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.render.Render3DEvent;
|
import me.retucio.sputnik.event.render.Render3DEvent;
|
||||||
import me.retucio.sputnik.event.events.render.RenderBlockOutlineEvent;
|
import me.retucio.sputnik.event.render.RenderBlockOutlineEvent;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||||
import me.retucio.sputnik.module.modules.render.NoRender;
|
import me.retucio.sputnik.module.modules.render.NoRender;
|
||||||
@@ -15,10 +15,8 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.RotationAxis;
|
||||||
import net.minecraft.util.profiler.Profiler;
|
import net.minecraft.util.profiler.Profiler;
|
||||||
import org.joml.Matrix4f;
|
import org.joml.Matrix4f;
|
||||||
import org.joml.Matrix4fc;
|
|
||||||
import org.joml.Vector4f;
|
import org.joml.Vector4f;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
|
||||||
import org.spongepowered.asm.mixin.injection.*;
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
|||||||
import com.llamalad7.mixinextras.sugar.Local;
|
import com.llamalad7.mixinextras.sugar.Local;
|
||||||
import me.retucio.sputnik.mixin.accessors.KeyBindingAccessor;
|
import me.retucio.sputnik.mixin.accessors.KeyBindingAccessor;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
import me.retucio.sputnik.module.modules.misc.CreativeInventoryHotbarKeybinds;
|
import me.retucio.sputnik.module.modules.inventory.CreativeInventoryHotbarKeybinds;
|
||||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||||
import net.minecraft.client.input.KeyInput;
|
import net.minecraft.client.input.KeyInput;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package me.retucio.sputnik.mixin.mixins.screen;
|
|||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import me.retucio.sputnik.command.CommandManager;
|
import me.retucio.sputnik.command.CommandManager;
|
||||||
import me.retucio.sputnik.config.ConfigManager;
|
import me.retucio.sputnik.config.ConfigManager;
|
||||||
import me.retucio.sputnik.event.events.input.ClientClickEvent;
|
import me.retucio.sputnik.event.input.ClientClickEvent;
|
||||||
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package me.retucio.sputnik.mixin.mixins.world;
|
|||||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.events.interact.BlockShapeEvent;
|
import me.retucio.sputnik.event.interact.BlockShapeEvent;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.ShapeContext;
|
import net.minecraft.block.ShapeContext;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.world;
|
package me.retucio.sputnik.mixin.mixins.world;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.events.network.ChunkOcclusionEvent;
|
import me.retucio.sputnik.event.network.ChunkOcclusionEvent;
|
||||||
import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder;
|
import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.mixin.mixins.world;
|
package me.retucio.sputnik.mixin.mixins.world;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.events.network.AddEntityEvent;
|
import me.retucio.sputnik.event.network.AddEntityEvent;
|
||||||
import me.retucio.sputnik.event.events.network.RemoveEntityEvent;
|
import me.retucio.sputnik.event.network.RemoveEntityEvent;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public enum Category {
|
|||||||
RENDER("renderizado"),
|
RENDER("renderizado"),
|
||||||
|
|
||||||
NETWORK("red"),
|
NETWORK("red"),
|
||||||
|
INVENTORY("inventario"),
|
||||||
|
|
||||||
CLIENT("cliente"),
|
CLIENT("cliente"),
|
||||||
MISC("misc."),
|
MISC("misc."),
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package me.retucio.sputnik.module;
|
package me.retucio.sputnik.module;
|
||||||
|
|
||||||
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.config.ConfigManager;
|
import me.retucio.sputnik.config.ConfigManager;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.sputnik.ToggleModuleEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.ToggleModuleEvent;
|
|
||||||
import me.retucio.sputnik.module.setting.SettingGroup;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
@@ -104,8 +104,8 @@ public class Module {
|
|||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
if (notify.getValue()) ChatUtil.info(getName() + " fue activado");
|
if (notify.getValue()) ChatUtil.info(getName() + " fue activado");
|
||||||
for (Method method : getClass().getDeclaredMethods())
|
for (Method method : getClass().getDeclaredMethods())
|
||||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
if (method.isAnnotationPresent(EventListener.class)) {
|
||||||
Sputnik.EVENT_BUS.register(this);
|
Sputnik.EVENT_BUS.subscribe(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
|
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
|
||||||
@@ -113,8 +113,8 @@ public class Module {
|
|||||||
|
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (notify.getValue()) ChatUtil.info(getName() + " fue desactivado");
|
if (notify.getValue()) ChatUtil.info(getName() + " fue desactivado");
|
||||||
if (Sputnik.EVENT_BUS.isRegistered(this))
|
if (Sputnik.EVENT_BUS.isSubscribed(this))
|
||||||
Sputnik.EVENT_BUS.unregister(this);
|
Sputnik.EVENT_BUS.unsubscribe(this);
|
||||||
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
|
Sputnik.EVENT_BUS.post(new ToggleModuleEvent(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.module;
|
package me.retucio.sputnik.module;
|
||||||
|
|
||||||
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
|
||||||
import me.retucio.sputnik.module.modules.client.DiscordRPC;
|
import me.retucio.sputnik.module.modules.client.DiscordRPC;
|
||||||
import me.retucio.sputnik.module.modules.client.HUD;
|
import me.retucio.sputnik.module.modules.client.HUD;
|
||||||
import me.retucio.sputnik.module.modules.camera.*;
|
import me.retucio.sputnik.module.modules.camera.*;
|
||||||
@@ -9,6 +9,7 @@ import me.retucio.sputnik.module.modules.combat.AttributeSwapper;
|
|||||||
import me.retucio.sputnik.module.modules.combat.MaceKill;
|
import me.retucio.sputnik.module.modules.combat.MaceKill;
|
||||||
import me.retucio.sputnik.module.modules.combat.ProjectileTrajectories;
|
import me.retucio.sputnik.module.modules.combat.ProjectileTrajectories;
|
||||||
import me.retucio.sputnik.module.modules.combat.SpearKill;
|
import me.retucio.sputnik.module.modules.combat.SpearKill;
|
||||||
|
import me.retucio.sputnik.module.modules.inventory.*;
|
||||||
import me.retucio.sputnik.module.modules.misc.*;
|
import me.retucio.sputnik.module.modules.misc.*;
|
||||||
import me.retucio.sputnik.module.modules.movement.*;
|
import me.retucio.sputnik.module.modules.movement.*;
|
||||||
import me.retucio.sputnik.module.modules.network.*;
|
import me.retucio.sputnik.module.modules.network.*;
|
||||||
@@ -51,8 +52,8 @@ public class ModuleManager {
|
|||||||
// registrar los "listeners" necesarios
|
// registrar los "listeners" necesarios
|
||||||
for (Module module : getEnabledModules()) {
|
for (Module module : getEnabledModules()) {
|
||||||
for (Method method : module.getClass().getDeclaredMethods()) {
|
for (Method method : module.getClass().getDeclaredMethods()) {
|
||||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
if (method.isAnnotationPresent(EventListener.class)) {
|
||||||
Sputnik.EVENT_BUS.register(module);
|
Sputnik.EVENT_BUS.subscribe(module);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,6 +91,7 @@ public class ModuleManager {
|
|||||||
add(new ChatPlus());
|
add(new ChatPlus());
|
||||||
add(new CreativeInventoryHotbarKeybinds());
|
add(new CreativeInventoryHotbarKeybinds());
|
||||||
add(new FakePlayer());
|
add(new FakePlayer());
|
||||||
|
add(new Replenish());
|
||||||
add(new ScreenshotPlus());
|
add(new ScreenshotPlus());
|
||||||
add(new ShulkerPeek());
|
add(new ShulkerPeek());
|
||||||
add(new UnfocusedCpu());
|
add(new UnfocusedCpu());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.module.modules.camera;
|
package me.retucio.sputnik.module.modules.camera;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.network.PacketEvent;
|
import me.retucio.sputnik.event.network.PacketEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
import me.retucio.sputnik.module.setting.settings.EnumSetting;
|
||||||
@@ -50,7 +50,7 @@ public class Autism extends Module {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onPacketSend(PacketEvent.Send event) {
|
private void onPacketSend(PacketEvent.Send event) {
|
||||||
if (event.getPacket() instanceof PlayerMoveC2SPacket.LookAndOnGround packet
|
if (event.getPacket() instanceof PlayerMoveC2SPacket.LookAndOnGround packet
|
||||||
&& packet.getYaw(yaw) != yaw) event.cancel();
|
&& packet.getYaw(yaw) != yaw) event.cancel();
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
package me.retucio.sputnik.module.modules.camera;
|
package me.retucio.sputnik.module.modules.camera;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.Stage;
|
import com.github.retucio.neutrino.Event;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.input.KeyEvent;
|
import me.retucio.sputnik.event.input.KeyEvent;
|
||||||
import me.retucio.sputnik.event.events.input.MouseClickEvent;
|
import me.retucio.sputnik.event.input.MouseClickEvent;
|
||||||
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
|
import me.retucio.sputnik.event.input.MouseScrollEvent;
|
||||||
import me.retucio.sputnik.event.events.interact.*;
|
import me.retucio.sputnik.event.interact.*;
|
||||||
import me.retucio.sputnik.event.events.network.ChunkOcclusionEvent;
|
import me.retucio.sputnik.event.network.ChunkOcclusionEvent;
|
||||||
import me.retucio.sputnik.event.events.network.DisconnectEvent;
|
import me.retucio.sputnik.event.network.DisconnectEvent;
|
||||||
import me.retucio.sputnik.event.events.network.PacketEvent;
|
import me.retucio.sputnik.event.network.PacketEvent;
|
||||||
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
|
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
|
||||||
import me.retucio.sputnik.mixin.mixins.io.KeyInputMixin;
|
import me.retucio.sputnik.mixin.mixins.io.KeyInputMixin;
|
||||||
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||||
@@ -207,10 +207,10 @@ public class Freecam extends Module {
|
|||||||
pos.set(pos.x + dx, pos.y + dy, pos.z + dz);
|
pos.set(pos.x + dx, pos.y + dy, pos.z + dz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onSendPacket(PacketEvent.Send event) {
|
private void onSendPacket(PacketEvent.Send event) {
|
||||||
if (!isEnabled() || !cancelActionPackets.getValue()) return;
|
if (!isEnabled() || !cancelActionPackets.getValue()) return;
|
||||||
if (event.getStage() != Stage.PRE) return;
|
if (event.getStage() != Event.Stage.PRE) return;
|
||||||
|
|
||||||
Packet<?> packet = event.getPacket();
|
Packet<?> packet = event.getPacket();
|
||||||
if (packet instanceof PlayerActionC2SPacket
|
if (packet instanceof PlayerActionC2SPacket
|
||||||
@@ -221,7 +221,7 @@ public class Freecam extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onKey(KeyEvent event) {
|
private void onKey(KeyEvent event) {
|
||||||
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_F3)) return;
|
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_F3)) return;
|
||||||
if (mc.currentScreen != null) return;
|
if (mc.currentScreen != null) return;
|
||||||
@@ -254,7 +254,7 @@ public class Freecam extends Module {
|
|||||||
if (shouldCancel) event.cancel();
|
if (shouldCancel) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onMouseClick(MouseClickEvent event) { // por si el restrasado del usuario usa el ratón para moverse
|
private void onMouseClick(MouseClickEvent event) { // por si el restrasado del usuario usa el ratón para moverse
|
||||||
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_F3)) return;
|
if (KeyUtil.isKeyDown(GLFW.GLFW_KEY_F3)) return;
|
||||||
if (mc.currentScreen != null) return;
|
if (mc.currentScreen != null) return;
|
||||||
@@ -287,7 +287,7 @@ public class Freecam extends Module {
|
|||||||
if (shouldCancel) event.cancel();
|
if (shouldCancel) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onMouseScroll(MouseScrollEvent event) {
|
private void onMouseScroll(MouseScrollEvent event) {
|
||||||
if (scrollSens.getValue() > 0 && mc.currentScreen == null && scrollKey.isDown()) {
|
if (scrollSens.getValue() > 0 && mc.currentScreen == null && scrollKey.isDown()) {
|
||||||
speed += event.getVertical() / 4 * (scrollSens.getValue() * speed);
|
speed += event.getVertical() / 4 * (scrollSens.getValue() * speed);
|
||||||
@@ -296,17 +296,17 @@ public class Freecam extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onChunkOcclusion(ChunkOcclusionEvent event) {
|
private void onChunkOcclusion(ChunkOcclusionEvent event) {
|
||||||
event.cancel();
|
event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onLeaveGame(DisconnectEvent event) {
|
private void onLeaveGame(DisconnectEvent event) {
|
||||||
toggle();
|
toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onPacketReceive(PacketEvent.Receive event) {
|
private void onPacketReceive(PacketEvent.Receive event) {
|
||||||
if (mc.player == null) return; // el jugador probablemente nunca sea nulo bajo estas circunstancias pero quién sabe
|
if (mc.player == null) return; // el jugador probablemente nunca sea nulo bajo estas circunstancias pero quién sabe
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ public class Freecam extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onOpenScreen(OpenScreenEvent event) {
|
private void onOpenScreen(OpenScreenEvent event) {
|
||||||
unpress();
|
unpress();
|
||||||
stopMoving();
|
stopMoving();
|
||||||
@@ -332,22 +332,22 @@ public class Freecam extends Module {
|
|||||||
|
|
||||||
// los paquetes ya se cancelan, pero visualmente estos eventos se siguen dando
|
// los paquetes ya se cancelan, pero visualmente estos eventos se siguen dando
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onBreakBlock(BreakBlockEvent event) {
|
private void onBreakBlock(BreakBlockEvent event) {
|
||||||
if (cancelActionPackets.getValue()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onPlaceBlock(PlaceBlockEvent event) {
|
private void onPlaceBlock(PlaceBlockEvent event) {
|
||||||
if (cancelActionPackets.getValue()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onInteractEntity(InteractEntityEvent event) {
|
private void onInteractEntity(InteractEntityEvent event) {
|
||||||
if (cancelActionPackets.getValue()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onAttack(AttackEntityEvent event) {
|
private void onAttack(AttackEntityEvent event) {
|
||||||
if (cancelActionPackets.getValue()) event.cancel();
|
if (cancelActionPackets.getValue()) event.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package me.retucio.sputnik.module.modules.camera;
|
package me.retucio.sputnik.module.modules.camera;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
|
import me.retucio.sputnik.event.input.MouseScrollEvent;
|
||||||
import me.retucio.sputnik.event.events.render.PerspectiveChangeEvent;
|
import me.retucio.sputnik.event.render.PerspectiveChangeEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.SettingGroup;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
@@ -45,12 +45,12 @@ public class PerspectivePlus extends Module {
|
|||||||
super.onEnable();
|
super.onEnable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onPerspectiveChange(PerspectiveChangeEvent event) {
|
private void onPerspectiveChange(PerspectiveChangeEvent event) {
|
||||||
distance = defaultDistance.getValue();
|
distance = defaultDistance.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onMouseScroll(MouseScrollEvent event) {
|
private void onMouseScroll(MouseScrollEvent event) {
|
||||||
if (mc.options.getPerspective() == net.minecraft.client.option.Perspective.FIRST_PERSON
|
if (mc.options.getPerspective() == net.minecraft.client.option.Perspective.FIRST_PERSON
|
||||||
|| mc.currentScreen != null || scrollSens.getValue() <= 0) return;
|
|| mc.currentScreen != null || scrollSens.getValue() <= 0) return;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.module.modules.camera;
|
package me.retucio.sputnik.module.modules.camera;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.render.ChangeRotationEvent;
|
import me.retucio.sputnik.event.render.ChangeRotationEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
@@ -40,7 +40,7 @@ public class Rotations extends Module {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onChangeRotation(ChangeRotationEvent event) {
|
private void onChangeRotation(ChangeRotationEvent event) {
|
||||||
if (smooth.getValue()
|
if (smooth.getValue()
|
||||||
&& (event.getYaw() != yaw.getFloatValue() || event.getPitch() != pitch.getFloatValue())){
|
&& (event.getYaw() != yaw.getFloatValue() || event.getPitch() != pitch.getFloatValue())){
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
package me.retucio.sputnik.module.modules.camera;
|
package me.retucio.sputnik.module.modules.camera;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.render.GetFOVEvent;
|
import me.retucio.sputnik.event.render.GetFOVEvent;
|
||||||
import me.retucio.sputnik.event.events.input.MouseScrollEvent;
|
import me.retucio.sputnik.event.input.MouseScrollEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.SettingGroup;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
import me.retucio.sputnik.module.setting.settings.KeySetting;
|
||||||
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
import me.retucio.sputnik.ui.screen.UpdateScreen;
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
// continúa en GameRendererMixin
|
// continúa en GameRendererMixin
|
||||||
@@ -88,7 +87,6 @@ public class Zoom extends Module {
|
|||||||
mc.options.getMouseSensitivity().setValue(prevMouseSens * mouseSensMultiplier.getValue());
|
mc.options.getMouseSensitivity().setValue(prevMouseSens * mouseSensMultiplier.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
private void onMouseScroll(MouseScrollEvent event) {
|
private void onMouseScroll(MouseScrollEvent event) {
|
||||||
boolean key = scrollKey.getValue() == GLFW.GLFW_KEY_UNKNOWN || scrollKey.isDown();
|
boolean key = scrollKey.getValue() == GLFW.GLFW_KEY_UNKNOWN || scrollKey.isDown();
|
||||||
if (isEnabled() && scrollSens.getValue() > 0 && key) {
|
if (isEnabled() && scrollSens.getValue() > 0 && key) {
|
||||||
@@ -99,7 +97,7 @@ public class Zoom extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onGetFov(GetFOVEvent event) {
|
private void onGetFov(GetFOVEvent event) {
|
||||||
event.setFov((float) (event.getFov() / value));
|
event.setFov((float) (event.getFov() / value));
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package me.retucio.sputnik.module.modules.client;
|
package me.retucio.sputnik.module.modules.client;
|
||||||
|
|
||||||
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.Sputnik;
|
import me.retucio.sputnik.Sputnik;
|
||||||
import me.retucio.sputnik.command.CommandManager;
|
import me.retucio.sputnik.command.CommandManager;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.TickEvent;
|
||||||
import me.retucio.sputnik.event.events.TickEvent;
|
import me.retucio.sputnik.event.sputnik.LoadClickGUIEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent;
|
import me.retucio.sputnik.event.sputnik.LoadCommandManagerEvent;
|
||||||
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent;
|
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.ModuleManager;
|
import me.retucio.sputnik.module.ModuleManager;
|
||||||
@@ -111,13 +111,13 @@ public class GUI extends Module {
|
|||||||
Category.CLIENT,
|
Category.CLIENT,
|
||||||
GLFW.GLFW_KEY_RIGHT_SHIFT);
|
GLFW.GLFW_KEY_RIGHT_SHIFT);
|
||||||
|
|
||||||
me.retucio.sputnik.Sputnik.EVENT_BUS.register(this);
|
Sputnik.EVENT_BUS.subscribe(this);
|
||||||
keyMode.setVisible(false);
|
keyMode.setVisible(false);
|
||||||
notify.setVisible(false);
|
notify.setVisible(false);
|
||||||
searchBar.onUpdate(v -> matchCase.setVisible(v));
|
searchBar.onUpdate(v -> matchCase.setVisible(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
public void onLoadCommandManager(LoadCommandManagerEvent event) {
|
public void onLoadCommandManager(LoadCommandManagerEvent event) {
|
||||||
commandPrefix.onUpdate(CommandManager.INSTANCE::setPrefix);
|
commandPrefix.onUpdate(CommandManager.INSTANCE::setPrefix);
|
||||||
commandPrefix.setDefaultValue(CommandManager.INSTANCE.getPrefix());
|
commandPrefix.setDefaultValue(CommandManager.INSTANCE.getPrefix());
|
||||||
@@ -128,7 +128,7 @@ public class GUI extends Module {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
public void onLoadClickGUI(LoadClickGUIEvent event) {
|
public void onLoadClickGUI(LoadClickGUIEvent event) {
|
||||||
color.onUpdate(v -> {
|
color.onUpdate(v -> {
|
||||||
Colors.red = color.getR();
|
Colors.red = color.getR();
|
||||||
@@ -139,7 +139,7 @@ public class GUI extends Module {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
public void onTick(TickEvent.Post event) {
|
public void onTick(TickEvent.Post event) {
|
||||||
if (color.isRainbow()) {
|
if (color.isRainbow()) {
|
||||||
Colors.red = color.getR();
|
Colors.red = color.getR();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.module.modules.combat;
|
package me.retucio.sputnik.module.modules.combat;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.interact.AttackEntityEvent;
|
import me.retucio.sputnik.event.interact.AttackEntityEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
@@ -33,7 +33,7 @@ public class AttributeSwapper extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
public void onAttack(AttackEntityEvent event) {
|
public void onAttack(AttackEntityEvent event) {
|
||||||
prevSlot = mc.player.getInventory().getSelectedSlot();
|
prevSlot = mc.player.getInventory().getSelectedSlot();
|
||||||
mc.player.getInventory().setSelectedSlot(slot.getIntValue() - 1);
|
mc.player.getInventory().setSelectedSlot(slot.getIntValue() - 1);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.module.modules.combat;
|
package me.retucio.sputnik.module.modules.combat;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.network.PacketEvent;
|
import me.retucio.sputnik.event.network.PacketEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
import me.retucio.sputnik.module.setting.settings.BooleanSetting;
|
||||||
@@ -46,8 +46,8 @@ public class MaceKill extends Module {
|
|||||||
max.onUpdate(v -> height.setVisible(!v));
|
max.onUpdate(v -> height.setVisible(!v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
@EventListener
|
||||||
private void onPacketSend(PacketEvent.Send event) {
|
private void onPacketSend(PacketEvent.Send event) {
|
||||||
if (mc.player == null) return;
|
if (mc.player == null) return;
|
||||||
if (mc.player.getMainHandStack().getItem() == Items.MACE
|
if (mc.player.getMainHandStack().getItem() == Items.MACE
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.retucio.sputnik.module.modules.combat;
|
package me.retucio.sputnik.module.modules.combat;
|
||||||
|
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import me.retucio.sputnik.event.events.render.Render3DEvent;
|
import me.retucio.sputnik.event.render.Render3DEvent;
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.SettingGroup;
|
import me.retucio.sputnik.module.setting.SettingGroup;
|
||||||
@@ -121,7 +121,7 @@ public class ProjectileTrajectories extends Module {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
public void onRenderWorld(Render3DEvent event) {
|
public void onRenderWorld(Render3DEvent event) {
|
||||||
if (mc.player == null) return;
|
if (mc.player == null) return;
|
||||||
renderProjectileTrajectory(event.getMatrices());
|
renderProjectileTrajectory(event.getMatrices());
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ public class SpearKill extends Module {
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+7
-7
@@ -1,9 +1,9 @@
|
|||||||
package me.retucio.sputnik.module.modules.misc;
|
package me.retucio.sputnik.module.modules.inventory;
|
||||||
|
|
||||||
|
import com.github.retucio.neutrino.EventListener;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||||
import me.retucio.sputnik.event.SubscribeEvent;
|
import me.retucio.sputnik.event.network.DisconnectEvent;
|
||||||
import me.retucio.sputnik.event.events.network.DisconnectEvent;
|
import me.retucio.sputnik.event.network.PacketEvent;
|
||||||
import me.retucio.sputnik.event.events.network.PacketEvent;
|
|
||||||
import me.retucio.sputnik.module.Category;
|
import me.retucio.sputnik.module.Category;
|
||||||
import me.retucio.sputnik.module.Module;
|
import me.retucio.sputnik.module.Module;
|
||||||
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
import me.retucio.sputnik.module.setting.settings.NumberSetting;
|
||||||
@@ -51,7 +51,7 @@ public class BundleDupe extends Module {
|
|||||||
public BundleDupe() {
|
public BundleDupe() {
|
||||||
super("dupe de bundle",
|
super("dupe de bundle",
|
||||||
"dupea items usando un bundle y un libro",
|
"dupea items usando un bundle y un libro",
|
||||||
Category.MISC
|
Category.INVENTORY
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,12 +68,12 @@ public class BundleDupe extends Module {
|
|||||||
this.waitingForKeepAlive = false;
|
this.waitingForKeepAlive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onDisconnect(DisconnectEvent event) {
|
private void onDisconnect(DisconnectEvent event) {
|
||||||
this.toggle();
|
this.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@EventListener
|
||||||
private void onPacketSend(PacketEvent.Send event) {
|
private void onPacketSend(PacketEvent.Send event) {
|
||||||
if (this.dupeActivated && event.getPacket() instanceof PlayerActionC2SPacket) {
|
if (this.dupeActivated && event.getPacket() instanceof PlayerActionC2SPacket) {
|
||||||
event.cancel();
|
event.cancel();
|
||||||
Loaded 100 of 151 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user