Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1eed6f957 | ||
|
|
c993d4fdac | ||
|
|
a9fd8da7f5 | ||
|
|
9b6d037b6c |
No files matched your search
+14
-5
@@ -11,20 +11,29 @@ base {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "FDD Maven"
|
||||
url = "https://maven.firstdark.dev/releases"
|
||||
}
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven {
|
||||
name = "FDD Maven"
|
||||
url = "https://maven.firstdark.dev/releases"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// mc
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
|
||||
// mappings
|
||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
|
||||
// fabric & su api
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
|
||||
|
||||
// otros
|
||||
// sistema de eventos
|
||||
modImplementation "com.github.retuci0:neutrino:${project.neutrino_version}"
|
||||
|
||||
// rpc de discord
|
||||
include(modImplementation "dev.firstdark.discordrpc:discord-rpc:1.0.3")
|
||||
}
|
||||
|
||||
|
||||
+7
-15
@@ -1,30 +1,22 @@
|
||||
# v2.9
|
||||
# v3.3
|
||||
|
||||
## novedades
|
||||
|
||||
varios módulos que no quería añadir porque son cheats en toda regla, pero ya total, como la mayoría que he añadido hasta la fecha es baneable
|
||||
- cambiado de sistema de eventos
|
||||
- categoría de inventario
|
||||
|
||||
### adiciones
|
||||
|
||||
- categoría de movimiento
|
||||
|
||||
#### módulos nuevos:
|
||||
|
||||
- packetmine: mina usando paquetes, para minar más rápido o para evitar la animación de minado
|
||||
- aliviar cpu: evita renderizar objetos en pantalla si la ventana no está seleccionada
|
||||
- delfín: *ruidos de delfín*
|
||||
- patinaje: esparce semen allá por donde pisas (haciéndolo más resbaladizo)
|
||||
- jesús: hermano se cree Jesús (camina sobre el agua)
|
||||
- info. de bloque: (muestra el contenido nbt de un bloque)
|
||||
- estampaescrotos: mazo en esteroides
|
||||
- tenedor mágico: hermano se cree Poseidón (tweaks a la propulsión acuática del tridente)
|
||||
- elytras: vuela con las elytras (en vez de solo planear)
|
||||
- barco volador: convierte tu bote de acacia en un caza militar
|
||||
- reponer: repone items a medida que se usan de forma automática
|
||||
|
||||
### arreglos / mejoras
|
||||
|
||||
- ahora puedes cambiar el título de la ventana en los ajustes del mod
|
||||
- ahora el grosor de línea de hitboxes funciona
|
||||
- ahora cabezas de chatplus funciona, a medias
|
||||
|
||||
## 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
|
||||
@@ -7,6 +7,9 @@ Trouser Streak: https://github.com/etianl/Trouser-Streak
|
||||
No More Purple: https://github.com/Pepperoni-Jabroni/NoMorePurple/
|
||||
bypass-resource-pack: https://github.com/emilyy-dev/bypass-resource-pack
|
||||
elytra-recast: https://github.com/InLieuOfLuna/elytra-recast/
|
||||
SpearHax: https://github.com/etianl/spearHax/
|
||||
ProjectileTrajectoryPreview: https://github.com/maDU59/ProjectilesTrajectoryPreview
|
||||
DupersUnited public addon: https://discord.gg/dupes | https://dupers.wtf
|
||||
|
||||
probablemente más pero como tengo demencia se me olvida
|
||||
si quieres que te acredite o quite tu código de mi mod, mándame un mensaje en discord (username: retucio) y sin problemas :)
|
||||
+3
-1
@@ -8,6 +8,8 @@ loom_version=1.13-SNAPSHOT
|
||||
|
||||
fabric_api_version=0.140.2+1.21.11
|
||||
|
||||
mod_version=2.9
|
||||
neutrino_version=1.1.0
|
||||
|
||||
mod_version=3.3
|
||||
maven_group=me.retucio
|
||||
archives_base_name=sputnik
|
||||
@@ -1,19 +1,18 @@
|
||||
package me.retucio.sputnik;
|
||||
|
||||
|
||||
import com.github.retucio.neutrino.EventBus;
|
||||
import me.retucio.sputnik.cape.CapeManager;
|
||||
import me.retucio.sputnik.command.CommandManager;
|
||||
import me.retucio.sputnik.command.commands.BindCommand;
|
||||
|
||||
import me.retucio.sputnik.config.ConfigManager;
|
||||
|
||||
import me.retucio.sputnik.event.EventBus;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.ShutdownEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadCapeManagerEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadClickGUIEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadCommandManagerEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.LoadModuleManagerEvent;
|
||||
import me.retucio.sputnik.event.ShutdownEvent;
|
||||
import me.retucio.sputnik.event.interact.OpenScreenEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadCapeManagerEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadClickGUIEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadCommandManagerEvent;
|
||||
import me.retucio.sputnik.event.sputnik.LoadModuleManagerEvent;
|
||||
|
||||
import me.retucio.sputnik.module.Module;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
@@ -22,6 +21,7 @@ import me.retucio.sputnik.module.modules.client.HUD;
|
||||
import me.retucio.sputnik.ui.hud.HudRenderer;
|
||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||
import me.retucio.sputnik.ui.hud.HudEditorScreen;
|
||||
import me.retucio.sputnik.ui.screen.UpdateScreen;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.settings.BindButton;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.SettingButton;
|
||||
import me.retucio.sputnik.ui.widgets.buttons.settings.TextButton;
|
||||
@@ -42,6 +42,7 @@ import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractCommandBlockScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
|
||||
@@ -51,7 +52,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
|
||||
|
||||
public class Sputnik implements ClientModInitializer {
|
||||
|
||||
// cosas necesarias
|
||||
@@ -82,19 +82,20 @@ public class Sputnik implements ClientModInitializer {
|
||||
mc = MinecraftClient.getInstance();
|
||||
ConfigManager.load();
|
||||
|
||||
EVENT_BUS.register(this);
|
||||
VersionChecker.check();
|
||||
|
||||
EVENT_BUS.register(ChatUtil.class);
|
||||
EVENT_BUS.register(DrawUtil.class);
|
||||
EVENT_BUS.register(EntityUtil.class);
|
||||
EVENT_BUS.register(InventoryUtil.class);
|
||||
EVENT_BUS.register(MiscUtil.class);
|
||||
EVENT_BUS.register(NetworkUtil.class);
|
||||
EVENT_BUS.register(RenderUtil.class);
|
||||
EVENT_BUS.subscribe(this);
|
||||
|
||||
EVENT_BUS.subscribe(ChatUtil.class);
|
||||
EVENT_BUS.subscribe(DrawUtil.class);
|
||||
EVENT_BUS.subscribe(EntityUtil.class);
|
||||
EVENT_BUS.subscribe(InventoryUtil.class);
|
||||
EVENT_BUS.subscribe(MiscUtil.class);
|
||||
EVENT_BUS.subscribe(NetworkUtil.class);
|
||||
EVENT_BUS.subscribe(RenderUtil.class);
|
||||
|
||||
Lists.init();
|
||||
|
||||
Textures.registerAll();
|
||||
Textures.init();
|
||||
|
||||
CapeManager.INSTANCE = new CapeManager();
|
||||
EVENT_BUS.post(new LoadCapeManagerEvent());
|
||||
@@ -188,8 +189,6 @@ public class Sputnik implements ClientModInitializer {
|
||||
if (key != ClientSettingsFrame.guiSettings.getKey() || anyFocused || isOnTypingScreen())
|
||||
return;
|
||||
|
||||
// al parecer esto hace que con la tecla de la interfaz puedas ir cambiando de splash text en la pantalla del título
|
||||
// pero me ha hecho gracia así que así se queda
|
||||
if (mc.currentScreen != ClickGUI.INSTANCE) {
|
||||
prevScreen = mc.currentScreen;
|
||||
mc.setScreen(ClickGUI.INSTANCE);
|
||||
@@ -233,7 +232,15 @@ public class Sputnik implements ClientModInitializer {
|
||||
|| mc.currentScreen instanceof AbstractCommandBlockScreen;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
// notificar al usuario de que hay una actualización disponible, si la hay
|
||||
public void onSetScreen(OpenScreenEvent event) {
|
||||
if (VersionChecker.shouldShowScreen && event.getScreen() instanceof TitleScreen) {
|
||||
event.cancel();
|
||||
VersionChecker.shouldShowScreen = false;
|
||||
mc.execute(() -> mc.currentScreen = new UpdateScreen());
|
||||
}
|
||||
}
|
||||
|
||||
public void onStop(ShutdownEvent event) {
|
||||
ConfigManager.save();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package me.retucio.sputnik.command;
|
||||
|
||||
import com.github.retucio.neutrino.EventListener;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.command.commands.*;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
@@ -32,24 +32,28 @@ public class CommandManager {
|
||||
|
||||
public static void registerCommands() {
|
||||
addCommand(new BindCommand());
|
||||
addCommand(new ClickSlotCommand());
|
||||
addCommand(new ConfigCommand());
|
||||
addCommand(new CopyScreenshotCommand());
|
||||
addCommand(new EnderChestCommand());
|
||||
addCommand(new GarbageCleanerCommand());
|
||||
addCommand(new PeekCommand());
|
||||
addCommand(new PluginsCommand());
|
||||
addCommand(new PrefixCommand());
|
||||
addCommand(new PurgeCommand());
|
||||
addCommand(new RepeatCommand());
|
||||
addCommand(new SaveScreenshotCommand());
|
||||
addCommand(new SendCommand());
|
||||
addCommand(new SpectateCommand());
|
||||
addCommand(new ToggleCommand());
|
||||
addCommand(new WaitCommand());
|
||||
|
||||
commands.sort(Comparator.comparing(Command::getName));
|
||||
|
||||
for (Command command : commands) {
|
||||
for (Method method : command.getClass().getDeclaredMethods()) {
|
||||
if (method.isAnnotationPresent(SubscribeEvent.class)) {
|
||||
Sputnik.EVENT_BUS.register(command);
|
||||
if (method.isAnnotationPresent(EventListener.class)) {
|
||||
Sputnik.EVENT_BUS.subscribe(command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package me.retucio.sputnik.command.args;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class EnumArgumentType<T extends Enum<T>> implements ArgumentType<T> {
|
||||
|
||||
private static final DynamicCommandExceptionType NO_SUCH_TYPE = new DynamicCommandExceptionType((value) -> Text.of(" argumento inválido: " + value));
|
||||
|
||||
private final T[] values;
|
||||
|
||||
public EnumArgumentType(T defaultValue) {
|
||||
this.values = defaultValue.getDeclaringClass().getEnumConstants();
|
||||
}
|
||||
|
||||
public static <T extends Enum<T>> EnumArgumentType<T> enumArgument(T defaultValue) {
|
||||
return new EnumArgumentType<>(defaultValue);
|
||||
}
|
||||
|
||||
public static <T extends Enum<T>> T getEnum(CommandContext<?> context, String name, T defaultValue) {
|
||||
return context.getArgument(name, defaultValue.getDeclaringClass());
|
||||
}
|
||||
|
||||
public T parse(StringReader reader) throws CommandSyntaxException {
|
||||
String argument = reader.readString();
|
||||
return Arrays.stream(this.values)
|
||||
.filter((value) -> value.toString().equals(argument))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> NO_SUCH_TYPE.create(argument)
|
||||
);
|
||||
}
|
||||
|
||||
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
|
||||
return CommandSource.suggestMatching(Arrays.stream(this.values).map(e -> e.toString().toLowerCase()), builder);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.EnumArgumentType;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
|
||||
// https://cdn.discordapp.com/attachments/1456079799045980400/1457154232737206375/dupersunited-public-addon-1.21.11-3.1.3.jar?ex=69735be1&is=69720a61&hm=77fb6faee49762e0a812661f0d98931e89cb725db711c45722249d0efe3b91e4&
|
||||
public class ClickSlotCommand extends Command {
|
||||
|
||||
public ClickSlotCommand() {
|
||||
super("clickslot", "simula un clic a un slot");
|
||||
}
|
||||
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.then(argument("slot", IntegerArgumentType.integer())
|
||||
.then(argument("botón", IntegerArgumentType.integer())
|
||||
.then(argument("acción", EnumArgumentType.enumArgument(SlotActionType.SWAP))
|
||||
.executes(context -> {
|
||||
int slot = context.getArgument("slot", Integer.class), button = context.getArgument("botón", Integer.class);
|
||||
SlotActionType action = context.getArgument("acción", SlotActionType.class);
|
||||
Screen screen = mc.currentScreen;
|
||||
int syncId = (screen instanceof GenericContainerScreen gcScreen) ? gcScreen.getScreenHandler().syncId : 0;
|
||||
mc.interactionManager.clickSlot(syncId, slot, button, action, mc.player);
|
||||
return SUCCESS;
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@ package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.TickEvent;
|
||||
import me.retucio.sputnik.event.TickEvent;
|
||||
import me.retucio.sputnik.ui.screen.PreviewScreen;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import me.retucio.sputnik.util.InventoryUtil;
|
||||
@@ -35,7 +34,6 @@ public class EnderChestCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(TickEvent.Post event) {
|
||||
if (shouldOpenEchest) {
|
||||
shouldOpenEchest = false;
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.tree.CommandNode;
|
||||
|
||||
import com.mojang.brigadier.tree.RootCommandNode;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.event.network.PacketEvent;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
|
||||
import net.minecraft.client.network.ClientCommandSource;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.network.packet.s2c.play.CommandTreeS2CPacket;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class PluginsCommand extends Command {
|
||||
private final Set<String> plugins = new HashSet<>();
|
||||
private boolean scanning = false;
|
||||
|
||||
public PluginsCommand() {
|
||||
super("plugins", "busca los plugins que tenga el server", "pl", "serverplugins");
|
||||
Sputnik.EVENT_BUS.subscribe(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.executes(context -> {
|
||||
if (mc.isIntegratedServerRunning()) {
|
||||
ChatUtil.error("estás en un solo jugador");
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (scanning) {
|
||||
ChatUtil.error("calmaaa");
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
plugins.clear();
|
||||
scanning = true;
|
||||
|
||||
findNamespaces();
|
||||
|
||||
return SUCCESS;
|
||||
});
|
||||
}
|
||||
|
||||
private void findNamespaces() {
|
||||
try {
|
||||
ClientPlayNetworkHandler networkHandler = mc.getNetworkHandler();
|
||||
if (networkHandler == null || networkHandler.getCommandDispatcher() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
RootCommandNode<ClientCommandSource> root = networkHandler.getCommandDispatcher().getRoot();
|
||||
root.getChildren().forEach(this::checkNodeForPlugins);
|
||||
|
||||
if (!plugins.isEmpty()) {
|
||||
ChatUtil.info(plugins.size() + " namespace(s) encontrado(s) de comandos:");
|
||||
plugins.stream()
|
||||
.sorted()
|
||||
.forEach(plugin -> ChatUtil.info(" - " + plugin));
|
||||
}
|
||||
|
||||
displayResults();
|
||||
|
||||
} catch (Exception e) {
|
||||
ChatUtil.error("error analizando comandos: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void checkNodeForPlugins(CommandNode<ClientCommandSource> node) {
|
||||
String name = node.getName();
|
||||
|
||||
if (name.contains(":")) {
|
||||
String namespace = name.split(":")[0];
|
||||
if (!namespace.equalsIgnoreCase("minecraft")
|
||||
&& !namespace.equalsIgnoreCase("bukkit")
|
||||
&& !namespace.equalsIgnoreCase("spigot")
|
||||
&& !namespace.equalsIgnoreCase("paper")) {
|
||||
plugins.add(namespace);
|
||||
}
|
||||
}
|
||||
|
||||
node.getChildren().forEach(this::checkNodeForPlugins);
|
||||
}
|
||||
|
||||
private void onPacketReceive(PacketEvent.Receive event) {
|
||||
if (!scanning) return;
|
||||
|
||||
if (event.getPacket() instanceof CommandTreeS2CPacket) {
|
||||
findNamespaces();
|
||||
}
|
||||
}
|
||||
|
||||
private void displayResults() {
|
||||
if (!plugins.isEmpty()) {
|
||||
ChatUtil.info(plugins.size() + " plugin(s) encontrado(s)");
|
||||
plugins.stream().sorted()
|
||||
.forEach(plugin -> ChatUtil.info(" - " + plugin));
|
||||
} else {
|
||||
ChatUtil.warn("sin plugins (probablemente)");
|
||||
}
|
||||
|
||||
scanning = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
public class RepeatCommand extends Command {
|
||||
|
||||
public RepeatCommand() {
|
||||
super("repetir", "repite un comando x veces", "repeat");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder
|
||||
.then(argument("veces", IntegerArgumentType.integer(1))
|
||||
.then(argument("comando", StringArgumentType.greedyString())
|
||||
.executes(ctx -> {
|
||||
int j = ctx.getArgument("veces", Integer.class);
|
||||
String command = ctx.getArgument("comando", String.class);
|
||||
for (int i = 0; i < j; i++) {
|
||||
ChatUtil.simulateChatMessage(command);
|
||||
}
|
||||
return SUCCESS;
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package me.retucio.sputnik.command.commands;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.mixin.accessor.ClientPlayNetworkHandlerAccessor;
|
||||
import me.retucio.sputnik.mixin.accessors.ClientPlayNetworkHandlerAccessor;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.network.encryption.NetworkEncryptionUtils;
|
||||
|
||||
@@ -3,8 +3,7 @@ package me.retucio.sputnik.command.commands;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.args.EntityArgumentType;
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.KeyEvent;
|
||||
import me.retucio.sputnik.event.input.KeyEvent;
|
||||
import me.retucio.sputnik.util.EntityUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -38,7 +37,6 @@ public class SpectateCommand extends Command {
|
||||
);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKey(KeyEvent event) {
|
||||
if (mc.getCameraEntity() != mc.player && mc.currentScreen == null
|
||||
&& event.getKey() == GLFW.GLFW_KEY_ESCAPE && event.getAction() != GLFW.GLFW_RELEASE ) {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package me.retucio.sputnik.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.retucio.sputnik.command.Command;
|
||||
import me.retucio.sputnik.command.CommandManager;
|
||||
import me.retucio.sputnik.ui.widgets.frames.settings.ClientSettingsFrame;
|
||||
import me.retucio.sputnik.util.ChatUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class WaitCommand extends Command {
|
||||
|
||||
private static final ScheduledExecutorService DELAYED_EXECUTOR = new ScheduledThreadPoolExecutor(2);
|
||||
|
||||
public WaitCommand() {
|
||||
super("wait", "espera un tiempo determinado antes de ejecutar otro comando", "esperar", "sleep", "delay");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder
|
||||
.then(argument("delay", IntegerArgumentType.integer(0))
|
||||
.then(argument("comando", StringArgumentType.greedyString())
|
||||
.executes(ctx -> {
|
||||
int delay = ctx.getArgument("delay", Integer.class);
|
||||
String command = ctx.getArgument("comando", String.class);
|
||||
|
||||
DELAYED_EXECUTOR.schedule(() -> ChatUtil.simulateChatMessage(command), delay, TimeUnit.MILLISECONDS);
|
||||
return SUCCESS;
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package me.retucio.sputnik.config;
|
||||
|
||||
import me.retucio.sputnik.event.SubscribeEvent;
|
||||
import me.retucio.sputnik.event.events.sputnik.*;
|
||||
import me.retucio.sputnik.event.sputnik.*;
|
||||
import me.retucio.sputnik.module.setting.settings.*;
|
||||
import me.retucio.sputnik.ui.screen.ClickGUI;
|
||||
|
||||
@@ -38,19 +37,17 @@ public class ClientConfig {
|
||||
public Map<String, String> hudImagePaths = new HashMap<>();
|
||||
|
||||
// posición de la barra de búsqueda (x, y)
|
||||
public int[] searchBarPosition = new int[]{340, 16};
|
||||
public int[] searchBarPosition = new int[] { 340, 16 };
|
||||
|
||||
public ClientConfig() {
|
||||
EVENT_BUS.register(this);
|
||||
EVENT_BUS.subscribe(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onToggleModule(ToggleModuleEvent event) {
|
||||
ConfigManager.setModuleState(event.getModule());
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SubscribeEvent
|
||||
public void onUpdateSetting(UpdateSettingEvent event) {
|
||||
if (mc == null || !event.shouldSave()) return;
|
||||
|
||||
@@ -71,24 +68,20 @@ public class ClientConfig {
|
||||
ConfigManager.setSetting(event.getSetting(), value);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOpenSettingsFrame(SettingsFrameEvent.Open event) {
|
||||
ConfigManager.setFramePosition(event.getFrame());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCloseSettingsFrame(SettingsFrameEvent.Close event) {
|
||||
settingsFrames.remove(event.getFrame().getModule().getName());
|
||||
ConfigManager.save();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMoveSettingsFrame(SettingsFrameEvent.Move event) {
|
||||
settingsFrames.replace(event.getFrame().getModule().getName(), new int[]{event.getFrame().getX(), event.getFrame().getY()});
|
||||
ConfigManager.save();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onExtendModuleFrame(ModuleFrameEvent.Extend event) {
|
||||
extendableFrames.put("M", new FrameData(
|
||||
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
||||
@@ -96,7 +89,6 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getModulesFrame().extended));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMoveModuleFrame(ModuleFrameEvent.Move event) {
|
||||
extendableFrames.replace("M", new FrameData(
|
||||
ClickGUI.INSTANCE.getModulesFrame().getX(),
|
||||
@@ -104,7 +96,6 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getModulesFrame().extended));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onExtendGUISettingsFrame(GUISettingsFrameEvent.Extend event) {
|
||||
extendableFrames.put("S", new FrameData(
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
||||
@@ -112,7 +103,6 @@ public class ClientConfig {
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().extended));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMoveGUISettingsFrame(GUISettingsFrameEvent.Move event) {
|
||||
extendableFrames.replace("S", new FrameData(
|
||||
ClickGUI.INSTANCE.getGuiSettingsFrame().getX(),
|
||||
|
||||
@@ -343,7 +343,7 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
private static String getSettingKey(Setting<?> setting) {
|
||||
return setting.getSg().getModule().getName() + ":" + setting.getName();
|
||||
return setting.getSg().getModule().getName() + ":" + setting.getTrueName();
|
||||
}
|
||||
|
||||
public static boolean hasLoaded() {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
// evento base, cancelable (usado en mixins)
|
||||
public class Event {
|
||||
|
||||
private boolean cancelled;
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
cancelled = true;
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.*;
|
||||
|
||||
// al llamar un evento, se guarda en el bus de eventos, de donde luego se puede detectar si ese evento ha sucedido
|
||||
public class EventBus {
|
||||
|
||||
private final Map<Class<?>, List<ListenerMethod>> listeners = new HashMap<>();
|
||||
|
||||
private record ListenerMethod(Object instance, Method method) {}
|
||||
|
||||
public void register(Object listener) {
|
||||
Class<?> targetClass;
|
||||
|
||||
if (listener instanceof Class<?> clazz) {
|
||||
targetClass = clazz; // "listeners" estáticos
|
||||
listener = null;
|
||||
} else {
|
||||
targetClass = listener.getClass();
|
||||
}
|
||||
|
||||
for (Method method : targetClass.getDeclaredMethods()) {
|
||||
if (!method.isAnnotationPresent(SubscribeEvent.class)) continue;
|
||||
if (method.getParameterCount() != 1) continue;
|
||||
|
||||
Class<?> eventType = method.getParameterTypes()[0];
|
||||
method.setAccessible(true);
|
||||
|
||||
if (listener == null && !Modifier.isStatic(method.getModifiers())) continue;
|
||||
|
||||
listeners.computeIfAbsent(eventType, k -> new ArrayList<>())
|
||||
.add(new ListenerMethod(listener, method));
|
||||
}
|
||||
}
|
||||
|
||||
public void subscribe(Object listener) { register(listener); }
|
||||
|
||||
public void unregister(Object listener) {
|
||||
for (List<ListenerMethod> list : listeners.values()) {
|
||||
list.removeIf(lm -> lm.instance == listener);
|
||||
}
|
||||
}
|
||||
|
||||
public void unsubscribe(Object listener) { unregister(listener); }
|
||||
|
||||
public <T extends Event> T post(T event) {
|
||||
List<ListenerMethod> list = listeners.get(event.getClass());
|
||||
if (list != null) {
|
||||
for (ListenerMethod lm : new ArrayList<>(list)) { // copiar para evitar CME
|
||||
try {
|
||||
lm.method.invoke(lm.instance, event);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return event;
|
||||
}
|
||||
|
||||
public boolean isRegistered(Object listener) {
|
||||
for (List<ListenerMethod> list : listeners.values()) {
|
||||
for (ListenerMethod lm : list) {
|
||||
if (lm.instance == listener) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see MinecraftClientMixin#onStop
|
||||
*/
|
||||
public class ShutdownEvent extends Event {
|
||||
|
||||
public ShutdownEvent() {}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
public enum Stage {
|
||||
PRE, // antes de que haya sucedido
|
||||
POST; // después de que haya sucedido
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
// anotación para registar un "listener", que escucha cuando se llama un evento
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface SubscribeEvent {}
|
||||
@@ -0,0 +1,15 @@
|
||||
package me.retucio.sputnik.event;
|
||||
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see MinecraftClientMixin#onTickPre
|
||||
* @see MinecraftClientMixin#onTickPost
|
||||
*/
|
||||
public class TickEvent {
|
||||
|
||||
public static class Pre extends Event {}
|
||||
public static class Post extends Event {}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ChunkOcclusionDataBuilderMixin#onChunkOcclusion
|
||||
*/
|
||||
public class ChunkOcclusionEvent extends Event {}
|
||||
@@ -1,12 +0,0 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onStop
|
||||
*/
|
||||
public class ShutdownEvent extends Event {
|
||||
|
||||
public ShutdownEvent() {}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPre
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onTickPost
|
||||
*/
|
||||
public class TickEvent {
|
||||
|
||||
public static class Pre extends Event {}
|
||||
public static class Post extends Event {}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.input;
|
||||
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import net.minecraft.text.ClickEvent;
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.input;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.io.KeyboardMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.KeyboardMixin#onKeyPress
|
||||
* @see KeyboardMixin#onKeyPress
|
||||
*/
|
||||
public class KeyEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.input;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseButton
|
||||
* @see MouseMixin#onMouseButton
|
||||
*/
|
||||
public class MouseClickEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.input;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.io.MouseMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MouseMixin#onMouseScroll
|
||||
* @see MouseMixin#onMouseScroll
|
||||
*/
|
||||
public class MouseScrollEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onAttackEntity
|
||||
* @see ClientPlayerInteractionManagerMixin#onAttackEntity
|
||||
*/
|
||||
public class AttackEntityEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package me.retucio.sputnik.event;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockBreak
|
||||
* @see ClientPlayerInteractionManagerMixin#onBlockBreak
|
||||
*/
|
||||
public class BreakBlockEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
public class ClipAtLedgeEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.item.ItemStackMixin;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ItemStackMixin#onDamage
|
||||
* @see ItemStackMixin#onDamage
|
||||
*/
|
||||
public class DamageItemEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onEntityInteract
|
||||
* @see ClientPlayerInteractionManagerMixin#onEntityInteract
|
||||
*/
|
||||
public class InteractEntityEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onOpenScreen
|
||||
* @see MinecraftClientMixin#onOpenScreen
|
||||
*/
|
||||
public class OpenScreenEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.player.ClientPlayerInteractionManagerMixin;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayerInteractionManagerMixin#onBlockPlace
|
||||
* @see ClientPlayerInteractionManagerMixin#onBlockPlace
|
||||
*/
|
||||
public class PlaceBlockEvent extends Event {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
public class SwitchSlotEvent extends Event {
|
||||
|
||||
private final int prevSlot;
|
||||
private int slot;
|
||||
|
||||
public SwitchSlotEvent(int prevSlot, int slot) {
|
||||
this.prevSlot = prevSlot;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public int getPrevSlot() {
|
||||
return prevSlot;
|
||||
}
|
||||
|
||||
public int getSlot() {
|
||||
return slot;
|
||||
}
|
||||
|
||||
public void setSlot(int slot) {
|
||||
this.slot = slot;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.interact;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onUseItem
|
||||
* @see MinecraftClientMixin#onUseItem
|
||||
*/
|
||||
public class UseItemEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onAddEntity
|
||||
* @see ClientWorldMixin#onAddEntity
|
||||
*/
|
||||
public class AddEntityEvent extends Event {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.world.ChunkOcclusionDataBuilderMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see ChunkOcclusionDataBuilderMixin#onChunkOcclusion
|
||||
*/
|
||||
public class ChunkOcclusionEvent extends Event {}
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
|
||||
import net.minecraft.client.network.ServerInfo;
|
||||
import net.minecraft.network.DisconnectionInfo;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onDisconnect
|
||||
* @see ClientConnectionMixin#onDisconnect
|
||||
*/
|
||||
public class DisconnectEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.misc.MinecraftClientMixin;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.MinecraftClientMixin#onJoinWorld
|
||||
* @see MinecraftClientMixin#onJoinWorld
|
||||
*/
|
||||
public class JoinWorldEvent extends Event {
|
||||
|
||||
+7
-12
@@ -1,34 +1,29 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import me.retucio.sputnik.event.Stage;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.network.ClientConnectionMixin;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPre
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onSendPacketPost
|
||||
* @see me.retucio.sputnik.mixin.ClientConnectionMixin#onReceivePacket
|
||||
* @see ClientConnectionMixin#onSendPacketPre
|
||||
* @see ClientConnectionMixin#onSendPacketPost
|
||||
* @see ClientConnectionMixin#onReceivePacket
|
||||
*/
|
||||
public class PacketEvent {
|
||||
|
||||
public static class Send extends Event {
|
||||
|
||||
private final Packet<?> packet;
|
||||
private final Stage stage;
|
||||
|
||||
public Send(Packet<?> packet, Stage stage) {
|
||||
this.packet = packet;
|
||||
this.stage = stage;
|
||||
this.setStage(stage);
|
||||
}
|
||||
|
||||
public Packet<?> getPacket() {
|
||||
return packet;
|
||||
}
|
||||
|
||||
public Stage getStage() {
|
||||
return stage;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Receive extends Event {
|
||||
+8
-5
@@ -1,17 +1,18 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.hud.ChatHudMixin;
|
||||
import net.minecraft.client.gui.hud.MessageIndicator;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ChatHudMixin#onAddMessage
|
||||
* @see ChatHudMixin#onAddMessage
|
||||
*/
|
||||
public class ReceiveMessageEvent extends Event {
|
||||
|
||||
private Text text;
|
||||
private MessageIndicator indicator;
|
||||
private int id;
|
||||
private final int id;
|
||||
private boolean modified = false;
|
||||
|
||||
public ReceiveMessageEvent(Text text, MessageIndicator indicator, int id) {
|
||||
@@ -42,5 +43,7 @@ public class ReceiveMessageEvent extends Event {
|
||||
return modified;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.world.ClientWorldMixin;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientWorldMixin#onRemoveEntity
|
||||
* @see ClientWorldMixin#onRemoveEntity
|
||||
*/
|
||||
public class RemoveEntityEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.network;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.network.ClientPlayNetworkHandlerMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.ClientPlayNetworkHandlerMixin#onSendMessage
|
||||
* @see ClientPlayNetworkHandlerMixin#onSendMessage
|
||||
*/
|
||||
public class SendMessageEvent extends Event {
|
||||
|
||||
+6
-5
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.entity.EntityMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.EntityMixin#onRotation
|
||||
* @see me.retucio.sputnik.mixin.EntityMixin#onChangeYaw
|
||||
* @see me.retucio.sputnik.mixin.EntityMixin#onChangePitch
|
||||
* @see EntityMixin#onRotation
|
||||
* @see EntityMixin#onChangeYaw
|
||||
* @see EntityMixin#onChangePitch
|
||||
*/
|
||||
public class ChangeRotationEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,10 +1,11 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.render.GameRendererMixin;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.GameRendererMixin#modifyFov
|
||||
* @see GameRendererMixin#modifyFov
|
||||
*/
|
||||
public class GetFOVEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.misc.GameOptionsMixin;
|
||||
import net.minecraft.client.option.Perspective;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.GameOptionsMixin#changePerspective
|
||||
* @see GameOptionsMixin#changePerspective
|
||||
*/
|
||||
public class PerspectiveChangeEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
|
||||
+4
-3
@@ -1,13 +1,14 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.render.WorldRendererMixin;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.WorldRendererMixin#render
|
||||
* @see WorldRendererMixin#render
|
||||
*/
|
||||
public class Render3DEvent extends Event {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderArm
|
||||
* @see HeldItemRendererMixin#onRenderArm
|
||||
*/
|
||||
public class RenderArmEvent extends Event {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
public class RenderBlockOutlineEvent extends Event {
|
||||
|
||||
private int color;
|
||||
private float lineWidth;
|
||||
|
||||
public RenderBlockOutlineEvent(int color, float lineWidth) {
|
||||
this.color = color;
|
||||
this.lineWidth = lineWidth;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public float getLineWidth() {
|
||||
return lineWidth;
|
||||
}
|
||||
|
||||
public void setLineWidth(float lineWidth) {
|
||||
this.lineWidth = lineWidth;
|
||||
}
|
||||
}
|
||||
+6
-5
@@ -1,6 +1,7 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.hud.BossBarHudMixin;
|
||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
@@ -8,9 +9,9 @@ import java.util.Iterator;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarIterator
|
||||
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifyBossBarName
|
||||
* @see me.retucio.sputnik.mixin.BossBarHudMixin#modifySpacingConstant
|
||||
* @see BossBarHudMixin#modifyBossBarIterator
|
||||
* @see BossBarHudMixin#modifyBossBarName
|
||||
* @see BossBarHudMixin#modifySpacingConstant
|
||||
*/
|
||||
public class RenderBossbarEvent {
|
||||
|
||||
+4
-3
@@ -1,12 +1,13 @@
|
||||
package me.retucio.sputnik.event.events;
|
||||
package me.retucio.sputnik.event.render;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.mixin.mixins.render.HeldItemRendererMixin;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
|
||||
/**
|
||||
* @see me.retucio.sputnik.mixin.HeldItemRendererMixin#onRenderItem
|
||||
* @see HeldItemRendererMixin#onRenderItem
|
||||
*/
|
||||
public class RenderHeldItemEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
// se genera cada que se interactúa con el marco de ajustes de la interfaz
|
||||
public class GUISettingsFrameEvent {
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
// se genera cuando carga el gestor de capas
|
||||
public class LoadCapeManagerEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
// se genera cuando carga la interfaz del mod
|
||||
public class LoadClickGUIEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
// se genera cuando carga el gestor de comandos
|
||||
public class LoadCommandManagerEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
public class LoadConfigEvent extends Event {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
// se genera cuando carga el gestor de módulos
|
||||
public class LoadModuleManagerEvent extends Event {}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
|
||||
// se genera cada que se interactúa con el marco de módulos
|
||||
public class ModuleFrameEvent {
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.ui.widgets.frames.SettingsFrame;
|
||||
|
||||
// se genera cada que se interactúa con un marco de ajustes de un módulo
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.module.Module;
|
||||
|
||||
// se genera cada que se enciende o apaga un módulo
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.event.events.sputnik;
|
||||
package me.retucio.sputnik.event.sputnik;
|
||||
|
||||
import me.retucio.sputnik.event.Event;
|
||||
import com.github.retucio.neutrino.Event;
|
||||
import me.retucio.sputnik.module.setting.Setting;
|
||||
|
||||
// se genera cada que se cambia el valor de un ajuste
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.block.entity.SignBlockEntity;
|
||||
import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.AnvilScreen;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.message.LastSeenMessagesCollector;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
@@ -0,0 +1,15 @@
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.entity.projectile.FishingBobberEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(FishingBobberEntity.class)
|
||||
public interface FishingBobberEntityAccessor {
|
||||
|
||||
@Accessor("caughtFish")
|
||||
boolean caughtFish();
|
||||
|
||||
@Accessor("state")
|
||||
FishingBobberEntity.State getState();
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.render.OverlayTexture;
|
||||
import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin.accessor;
|
||||
package me.retucio.sputnik.mixin.accessors;
|
||||
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.event.BoatMoveEvent;
|
||||
import me.retucio.sputnik.event.interact.BoatMoveEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.movement.BoatFly;
|
||||
import net.minecraft.entity.MovementType;
|
||||
+11
-4
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import me.retucio.sputnik.event.events.ChangeRotationEvent;
|
||||
import me.retucio.sputnik.event.render.ChangeRotationEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
import me.retucio.sputnik.module.modules.camera.Freelook;
|
||||
@@ -20,10 +20,8 @@ import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@@ -102,6 +100,15 @@ public abstract class EntityMixin {
|
||||
return original;
|
||||
}
|
||||
|
||||
@ModifyReturnValue(method = "getName", at = @At("RETURN"))
|
||||
private Text showTntPrimeTime(Text original) {
|
||||
if (!nametags.isEnabled() || !nametags.tntPrime.getValue()) return original;
|
||||
if ((Object) this instanceof TntEntity tnt) {
|
||||
return Text.of(nametags.getTntPrimeTime(tnt));
|
||||
}
|
||||
return original;
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
@ModifyReturnValue(method = "getCustomName", at = @At("RETURN"))
|
||||
private Text displayEntityOwner(Text original) {
|
||||
@@ -0,0 +1,37 @@
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.render.EntityESP;
|
||||
import net.minecraft.client.render.entity.EntityRenderer;
|
||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(EntityRenderer.class)
|
||||
public abstract class EntityRendererMixin {
|
||||
|
||||
@Unique
|
||||
private EntityESP esp;
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void getModules(EntityRendererFactory.Context context, CallbackInfo ci) {
|
||||
esp = ModuleManager.INSTANCE.getModuleByClass(EntityESP.class);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(method = "updateRenderState", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;hasOutline(Lnet/minecraft/entity/Entity;)Z"))
|
||||
private boolean renderGlowESP(boolean original, @Local(argsOnly = true) Entity entity) {
|
||||
return (esp.isEnabled() && esp.mode.is(EntityESP.ESPMode.GLOW) && esp.entities.isEnabled(entity.getType())) || original;
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(method = "updateRenderState", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getTeamColorValue()I"))
|
||||
private int setGlowESPColor(int original, @Local(argsOnly = true) Entity entity) {
|
||||
if (esp.isEnabled() && esp.mode.is(EntityESP.ESPMode.GLOW) && esp.entities.isEnabled(entity.getType())) return esp.glowColor.getRGB();
|
||||
return original;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.entity;
|
||||
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.movement.ElytraBounce;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.retucio.sputnik.event.events.RenderBossbarEvent;
|
||||
import me.retucio.sputnik.event.render.RenderBossbarEvent;
|
||||
import net.minecraft.client.gui.hud.BossBarHud;
|
||||
import net.minecraft.client.gui.hud.ClientBossBar;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -0,0 +1,52 @@
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyReceiver;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import net.minecraft.client.font.Alignment;
|
||||
import net.minecraft.client.font.DrawnTextConsumer;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.hud.ChatHud;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.util.math.ColorHelper;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ChatHud.Interactable.class)
|
||||
public abstract class ChatHudInteractableMixin {
|
||||
|
||||
@Unique
|
||||
private static ChatPlus chatPlus;
|
||||
|
||||
@Shadow @Final
|
||||
private DrawContext context;
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void getModules(DrawContext context, TextRenderer textRenderer, int mouseX, int mouseY, boolean bl, CallbackInfo ci) {
|
||||
chatPlus = ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class);
|
||||
}
|
||||
|
||||
@ModifyReceiver(method = "text", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/DrawnTextConsumer;text(Lnet/minecraft/client/font/Alignment;IILnet/minecraft/client/font/DrawnTextConsumer$Transformation;Lnet/minecraft/text/OrderedText;)V"))
|
||||
private DrawnTextConsumer onRender_beforeDrawTextWithShadow(DrawnTextConsumer instance, Alignment alignment, int x, int y, DrawnTextConsumer.Transformation transformation, OrderedText orderedText) {
|
||||
chatPlus.beforeDrawMessage(context, y, ColorHelper.getWhite(transformation.opacity()));
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ModifyArg(method = "text", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/DrawnTextConsumer;text(Lnet/minecraft/client/font/Alignment;IILnet/minecraft/client/font/DrawnTextConsumer$Transformation;Lnet/minecraft/text/OrderedText;)V"), index = 1)
|
||||
private int modifyX(int x) {
|
||||
return (chatPlus.isEnabled() && chatPlus.showHeads.getValue()) ? x + 10 : x;
|
||||
}
|
||||
|
||||
@Inject(method = "text", at = @At("TAIL"))
|
||||
private void onRender_afterDrawTextWithShadow(int y, float f, OrderedText text, CallbackInfoReturnable<Boolean> cir) {
|
||||
chatPlus.afterDrawMessage();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(targets = "net.minecraft.client.gui.hud.ChatHud$1", remap = false)
|
||||
public abstract class ChatHudLineConsumerMixin {
|
||||
|
||||
@Inject(method = "accept", at = @At("HEAD"))
|
||||
private void setLine(ChatHudLine.Visible line, int y, float opacity, CallbackInfo ci) {
|
||||
ModuleManager.INSTANCE.getModuleByClass(ChatPlus.class).line = line;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHudLine;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHudLineVisible;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.retucio.sputnik.event.events.ReceiveMessageEvent;
|
||||
import me.retucio.sputnik.event.network.ReceiveMessageEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.util.interfaces.IChatHud;
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.hud;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.event.events.Render2DEvent;
|
||||
import me.retucio.sputnik.event.render.Render2DEvent;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ChatPlus;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.io;
|
||||
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.camera.Freecam;
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.io;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
import me.retucio.sputnik.event.events.KeyEvent;
|
||||
import me.retucio.sputnik.event.input.KeyEvent;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.input.KeyInput;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.io;
|
||||
|
||||
import me.retucio.sputnik.event.events.MouseClickEvent;
|
||||
import me.retucio.sputnik.event.events.MouseScrollEvent;
|
||||
import me.retucio.sputnik.event.input.MouseClickEvent;
|
||||
import me.retucio.sputnik.event.input.MouseScrollEvent;
|
||||
import net.minecraft.client.Mouse;
|
||||
import net.minecraft.client.input.MouseInput;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.io;
|
||||
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ScreenshotPlus;
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.item;
|
||||
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.misc.ShulkerPeek;
|
||||
import me.retucio.sputnik.module.modules.inventory.ShulkerPeek;
|
||||
import net.minecraft.block.ShulkerBoxBlock;
|
||||
import net.minecraft.component.type.TooltipDisplayComponent;
|
||||
import net.minecraft.item.BlockItem;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.item;
|
||||
|
||||
import me.retucio.sputnik.event.events.DamageItemEvent;
|
||||
import me.retucio.sputnik.event.interact.DamageItemEvent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
+1
-5
@@ -1,16 +1,12 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.item;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import me.retucio.sputnik.module.ModuleManager;
|
||||
import me.retucio.sputnik.module.modules.movement.TridentBoost;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.TridentItem;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
@Mixin(TridentItem.class)
|
||||
+4
-3
@@ -1,4 +1,4 @@
|
||||
package me.retucio.sputnik.mixin;
|
||||
package me.retucio.sputnik.mixin.mixins.misc;
|
||||
|
||||
import me.retucio.sputnik.Sputnik;
|
||||
|
||||
@@ -30,8 +30,9 @@ public abstract class FontManagerMixin {
|
||||
if (id.equals(StyleSpriteSource.Font.DEFAULT.id())) {
|
||||
cir.setReturnValue(getStorageInternal(
|
||||
Identifier.of(
|
||||
Sputnik.MOD_ID,
|
||||
fonts.font.getValue())
|
||||
Sputnik.MOD_ID,
|
||||
fonts.getFont()
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
Loaded 100 of 259 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user